Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL-Query

Status
Not open for further replies.

stwi1974

Programmer
Jan 29, 2002
17
DE
Hi!

I got a problem with a SQL-Query to create.

I got this query:

SELECT a.id
FROM table1 a, table2 b, table3 c
WHERE a.id=b.parentid AND
b.id=c.id AND
b.parentid IN (SELECT id FROM table2 WHERE parentid = 4711) AND
c.name like '%smith%'

I got table1 with foreign key of table2, table2 got parent key to another row in its own table and table3 including the name, but not always the two steps between ... is there a better possibility to solve this problem without using one query for 2 steps between and one for 3 steps, ...?

THX in advance!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top