Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL statement not right...
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01146549
Message ID:
01146576
Vues:
15
Thanks Sergey, I had it pretty close!

>Hi Kevin,
>
>I'm not familiar with ORACLE but you should be able to adapt following MS SQL query
>
SELECT t2.col1, CASE WHEN t2.col2 IS NOT NULL THEN 'Y' ELSE 'N' END
>  FROM table2 t2
>   LEFT JOIN table1 t1 ON t1.col1 = t2.col1
>
>>I have a select I my brain can't create correctly today....2 tables, oracle database.
>>
>>
>>Table 1
>>3  AA
>>4  AA
>>1  AB
>>3  AB
>>
>>Table 2
>>1
>>2
>>3
>>4
>>5
>>
>>
>>Trying to create a select statement to return all records from table 2, and creates a field in the result that hold "Y" or "N" based on existence of match in table 1 for user. So if I am searching for "AB", result would be:
>>
>>
>>1 Y
>>2 N
>>3 Y
>>4 N
>>5 N
>>
>>
>>All my attempts are not quite right today....
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform