Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Logical columns in SQL Server
Message
De
30/07/2001 15:17:41
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Logical columns in SQL Server
Divers
Thread ID:
00537398
Message ID:
00537398
Vues:
39
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.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform