Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / DB Engine / SQL Server CE / January 2008

Tip: Looking for answers? Try searching our database.

SQL Syntax: SELECT ... UNION

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michael Hanke - 02 Jan 2008 18:55 GMT
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 b.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
chora - 08 Jan 2008 06:53 GMT
I suppose a.column is the same with b.column right? I believ you cannot
have a different sort column in a union, because there is a single
result set. I cannot test it right now, but I believe the ORDER BY can
exist in only one of the queries. The sorting will affect the entire
set.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.