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!
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!