I have two tables like
table1:
word ida 1a 2a 10c 20d 21e 30table2:
id1 id21 202 21Now if word='a' then I need to find out 'c' and 'd' using table1 and table2: I wrote a query, its working but taking too much time, because tables include huge data.
Query:
SELECT word FROM table1 WHERE id IN (SELECT id2 FROM table2 WHERE id1 IN ( SELECT id FROM table1 WHERE word = 'a'))Another query:
SELECT DISTINCT word FROM table1 WHERE id IN (SELECT id FROM table1 WHERE word = 'a')
ليست هناك تعليقات:
إرسال تعليق