SQL Server Mobile subquery allowed?

I apologize if this is the wrong forum, but I cannot find a forum dedicated to SQLServer Mobile...

My question is whether or not subqueries are allowed in SQL statements in SQL Sever Mobile. For example:

select a.Id, a.DefaultDescription,(select b.Categoryfrom OldvListItem bwhere b.Description= a.DefaultDescription) Categoryfrom ListItem a

This is giving me the following error: ....Token in error = select

Is this a limitation of SQL Server Mobile? Or am I doing something stupid? I would like to use subqueries in INSERT and UPDATE statements too...

Thanks,

Chris

[1455 byte] By [ChrisD] at [2007-12-16]
# 1
Why don't you simply unwrap the query?

select a.Id, a.DefaultDescription, b.Category Category from ListItem a INNER JOIN OldvListItem b ON b.Description = a.DefaultDescription

One other thing to keep in mind - try to avoid linking tables on the string coulmn. Use IDs where possible

AlexFeinman at 2007-9-9 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 2
Thank you for your reply. I guess my example was a little simplistic and an inner join works well in that case.

I'm guessing from your answer that subqueries are not allowed in SQL Mobile. But how about an UPDATE statement? Let's say I need to update a column in table A with data from table B?

TableA:
Id
DescriptionId
BlankColumn

TableB:
Id
Description

UPDATE TableA a SET BlankColumn = (SELECT b.Description FROM TableB b
WHERE b.Id = a.DescriptionId)

Is this type of subquery possible (it doesn't seem to work...same error)? How else would I get data from another table in an update statement? (Actually, this is largely an acedemic question now; I've already gone and wrote a VB.NET routine to solve the problem).

(BTW: I'm dealing with legacy data that eschewed artifical keys, and I'm trying to copy this data into tables with ID key columns...hence the need for the above statements)

Thanks Again,

Chris

ChrisD at 2007-9-9 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 3

ChrisD,

Did you ever get an answer on this post? I'm running into the same problem with trying to use a subquery in my SQL Server Mobile Edition.

Are they allowed? If so, is there some special syntax I need to use?

Thanks

mrclennon at 2007-9-9 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 4
I need an answer for this post too, i have the same problem when trying to update with a subquery in my sql server mobile edition

Thanks

Ducolino at 2007-9-9 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 5
From the change list of SQL Compact Edition it looks like this version is going to support it. With SQL Mobile it just does not work and you will have to figure out a way you don't need a subquery.
uitmaurik at 2007-9-9 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...