Sorry I forgot to mention I was using where field=(select field from table).
I've pasted 2 bits of code which do the same thing...
Are you able to tell me if one is better than the other?
Firstly,
SELECT field1, field2, field3
FROM table1
WHERE field3 IN (SELECT field3
FROM table2
WHERE field4 IN (SELECT field4
FROM table3
WHERE field5 LIKE 'MEL%'
AND field4 IN (SELECT field4
FROM table4
WHERE field6 IN (SELECT field6
FROM table5
WHERE field7 IN (SELECT field7
FROM table6
WHERE field8 = '123456789')))));
Secondly,
SELECT table1.field1, table1.field2, table1.field3
FROM table1, table2, table3, table4, table5, table6
WHERE table1.field3 = table2.field3 AND table2.field4 = table3.field4 AND table3.field5 LIKE 'ABC%' AND table3.field4 = table4.field4 AND table4.field6 = table5.field6 AND table5.field7 = table6.field7 and field8 = '123456789';
Or are the both as bad as each other? If so, can you give me some suggestions to point me in the right direction?
Thanks,
Matthew