How write a sql query to check multiple condition is true the data fetch from multiple table | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How write a sql query to check multiple condition is true the data fetch from multiple table

eg: Table 1, Table 2, Table 3 need to check 1 condition from Table 1 as true and next condition from Table 2 as true and next condition from Table 3 as true. KINDLY HELP ME WITH THIS QUERY. Select a. Name , a. Mail, b.name, b.mail from user as a join user_details as d on a.id =d.userid join user as b on a. Reports_to = b. Position_no Where a.employee='E' AND d.intial=1 And b.supervisor=1 Then where condition takes time to load the output.

16th Oct 2020, 2:38 AM
Gayathri. A
4 Answers
+ 1
First show your attempt
16th Oct 2020, 2:40 AM
Sâñtôsh
Sâñtôsh - avatar
0
Why table 'user' is referenced twice with different alias "a" and "b"?
16th Oct 2020, 3:27 AM
Ipang
0
Need to validate 2 columns in same table so used a,b
16th Oct 2020, 4:49 AM
Gayathri. A
0
So you are looking forward to get name & e-mail of both the employee and his/her supervisor; is this what you are planning to do? cause I'm not sure. Tell me more about these fields, a.employee d.intial b.supervisor
16th Oct 2020, 6:06 AM
Ipang