jaczura

Hello!

Could you help me how to implement query in query in SQL CE or Mobile

I tried: SELECT cell1 FROM table1 WHERE ID=(SELECT cell2 FROM table2 WHERE ID>0)

but didn't work.

Thanks!


Re: Smart Devices VB and C# Projects query in query

Ilya Tumanov

Nested queries are not supported, use join instead.






Re: Smart Devices VB and C# Projects query in query

Christopher Fairbairn

Hi,

This depends upon the version of SQL Mobile / SQL Server CE etc you are using. Newer versions do support this syntax. Try the following query (notice the use of the IN keyword instead of a '=')

SELECT cell1 FROM table1 WHERE ID IN (SELECT cell2 FROM table2 WHERE ID>0)

As IIlya mentioned a more generic and portabel solution would be to convert the query into a table join.

Hope this helps,

Christopher Fairbairn