vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello 2 simply tables table1 Clientid col1 1 A 2 A 3 B table2 Clientid col1 col2 1 A A 1 A B 1 B A 2 A B 2 B A 3 A A 3 B A i'm searching Clientid's which have in table1,col1 an A and in table2 with same clientid DONT have a row A A result is Clientid 2 can anyone help me thanx inc. |
| ||||
| SELECT t1.id FROM table1 t1 LEFT JOIN table2 t2 ON t1.id=t2.id AND t2.col1 = 'A' AND t2.col2 = 'A' WHERE t1.col1 = 'A' AND t2.id IS NULL incogni@gmx.de schrieb: > Hello > > 2 simply tables > > table1 > Clientid col1 > 1 A > 2 A > 3 B > > table2 > Clientid col1 col2 > 1 A A > 1 A B > 1 B A > 2 A B > 2 B A > 3 A A > 3 B A > > i'm searching Clientid's which have in table1,col1 an A and in table2 > with same clientid DONT have a row A A > > result is Clientid 2 > > can anyone help me > > thanx > inc. |