Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Annoying SQL Query
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00435486
Message ID:
00436300
Vues:
20
Hi!

Correct, but not for all versions.

>>Yes, now its much clear. Following is completed qyery:
>>
>>
>>SELECT RR.ID as Request, RR.EmployeeID as Employee,
>>      RR.CourseID as Course, PP.PrerequisiteID as Prereq,
>>      iif(IsNull(Completion.StatusID,0,Completion.StatusID)) as Completed
>>  FROM
>>    (Requests as RR
>>      INNER JOIN Courses as CC
>>        ON RR.CourseID = CC.ID
>>      LEFT JOIN Prerequisites PP
>>        ON PP.CourseID = CC.ID)
>>    LEFT JOIN Requests as Completion
>>      ON Completion.CourseID = PP.CourseID AND Completion.EmployeeID = Requests.EmployeeID
>>
>>
>>HTH.
>

>You can use NVL function to convert NULL value
>
>NVL(Completion.StatusID,0) as Completed
>instead of
>iif(IsNull(Completion.StatusID,0,Completion.StatusID)) as Completed
>
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform