SQL Syntax: SELECT ... UNION

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi all together,

I am migrating an SQL project to SQLCE 3.5

A statement like

(SELECT <column_list> FROM Table AS a
WHERE <where_clause1>
ORDER BY a.column)

UNION

(SELECT <column_list> FROM Table AS b
WHERE <where_clause2>
ORDER BY a.column DESC)

produces an error at the first "ORDER" token:

"There was an error parsing the query. [ Token line number = 1,Token line offset = 133,Token in error = ORDER ]"
Source="SQL Server Compact ADO.NET Data Provider"


Doesn't SQLCE support UNIONs with ORDERing statements?

Thank you for your hints!

Michael
.



Relevant Pages

  • SQL Syntax: SELECT ... UNION
    ... I am migrating an SQL project to SQLCE 3.5 ... Doesn't SQLCE support UNIONs with ORDERing statements? ...
    (microsoft.public.sqlserver.ce)
  • Re: Migrate from Access
    ... Is tehere any tool for migrating from Access to SQLCe? ... Meelis ...
    (microsoft.public.sqlserver.ce)