Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Logical columns in SQL Server
Message
From
30/07/2001 15:17:41
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Logical columns in SQL Server
Miscellaneous
Thread ID:
00537398
Message ID:
00537398
Views:
40
In SQL passthrough queries, is there a way other than a brute force double query joined with UNION ALL to return the results of a logical exression as a column? This syntax is not accepted by MS SQL Server:

SELECT CLIENTFIRST, CLIENTLAST, STAFF_KEY=12 AS MYCLI FROM CLIENTS

the trick of

SELECT CLIENTFIRST, CLIENTLAST, 1 AS MYCLI FROM CLIENTS WHERE STAFF_KEY=12
UNION ALL
SELECT CLIENTFIRST, CLIENTLAST, O AS MYCLI FROM CLIENTS WHERE STAFF_KEY<>12

gets very unwieldy when you want multiple logical columns.
Randy Hersom
President, Habilitation Software Inc.
Next
Reply
Map
View

Click here to load this message in the networking platform