Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
One of 3 possible joins...
Message
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
One of 3 possible joins...
Divers
Thread ID:
00930847
Message ID:
00930847
Vues:
51
I want to do a join between two tables - but there are three possible ways I can join them.

If the FK exists, I want to join on that - but if it doesn't, I'll create a join on another field (through an intermediate table) and if there's no corresponding record in the intermediate table, I'll try a join on another field before finally giving up and returning a NULL.

I know I can do three JOIN ... AS ... statements and just have a seperate result field for each option (which I can subsequently check in code with nested VFP IIF's), but I was hoping for a prettier way involving fewer fields in the returned cursor.

Any suggestions from the experts out there?

TIA
Kogo Michael Hogan

"Pinky, are you pondering what I'm pondering?"
I think so Brain, but "Snowball for Windows"?

Ideate Web Site
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform