I have 3 tables T1, T2,T3 with values as shown below. T1 T2 T3 A B C X Y J K L A11 B11 C11 A11 Y11 J11 K11 Y11 A12 B11 C12 A11 Y12 J12 K12 Y12 A13 B12 C13 A11 Y11 J13 K13 Y13 A14 B12 C14 A12 Y12 J14 K14 Y14 A15 B12 C15 A13 Y11 J15 K15 Y15 Query 1: Select b from (Select count(*) b from T1, T2 where T1.A = T2.X and T2.Y = ?) where b>0; where ‘?’ => a value from table T3 in column L Suppose if I replace ‘?’ with Y11 the output of the query is as follows B ---- 3 Query 2: Select T3.J, T3.K, T3.L from T3 where T3.K='K11' Output J K L ------------------- J11 K11 L11 I need the output in the following format using a single query T3.J T3.K T3.L b -------------------------- J11 K11 L11 3 ie., all the fields in the table t3(second query) and the count obtained in the first query. For this purpose the query 1 and query2 needs to be combined… All the above relations hold good Ie., T2.X contains values present in T1.A T3.L contains values present in T2.Y PS: the problem is that in query 1, the value replacing ‘?’ is a value from T3. I will not be able to join T3 and T1 with any matching criteria as there is no common fields in these two tables. Also simply I can’t join T3 in the first query since it will result in the wrong number of count being fetched The second query will always return only one row