Atul_Vaidya wrote: > > > SELECT DISTINCT Entity_xData.grpuid from Entity_xdata INNER JOIN > group_id_vs_regappname ON(Entity_xdata.grpuid = > group_id_vs_regappname.grpuid AND group_id_vs_regappname.reg_appname = > 'CPD1') > I get the grpuids using this command and then i use the grpuids that i get > from this query, as an input to my next query, something like this ... > > SELECT DISTINCT Line_Number_View FROM (SELECT grpuid,line_number_view FROM > group_xdata_pipe WHERE grpuid = '%s' ORDER BY grpuid ASC)ORDER BY > Line_Number_View ASC",query_result[x]) > > My question is > Is it possible to combine both these querries into one ? or in other words > How to Select using Result obtained from other Select statements ? > Thanks in Advance, > Atul > atul.vai...@prototechsolutions.com Hi, I was able to achieve this by using two INNER JOINS as follows .... Select DISTINCT group_xdata_pipe.Line_Number_View from group_xdata_pipe INNER JOIN Entity_xData ON(group_xdata_pipe.grpuid = Entity_xData.grpuid)INNER JOIN group_id_vs_regappname ON(Entity_xdata.grpuid = group_id_vs_regappname.grpuid AND group_id_vs_regappname.reg_appname = 'CPD1') Thanks, and any suggestions to this query are welcome, i am sure, there must be some more elegant ways of doing this. Regards, Atul -- View this message in context: http://www.nabble.com/how-to-Select-using-results-from-other-selects-in-a-single-SQlite-querry-statement---tp25149885p25151110.html Sent from the SQLite mailing list archive at Nabble.com.
_______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users