Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Aggregate Function Know-How Needed
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01442673
Message ID:
01442729
Vues:
27
>>>That is why SET ENGINEBEHAVIOR 90 was presente, to make VFP queries more ANSI compatible.
>>>
>>>SELECT partmast.partnum,
>>>	partmast.title,
>>>	partmast.description,
>>>	NVL(partstats.emplviews+partstats.intviews,0000000) as Total_Views,
>>>	invitems.Cnt as sales_count 
>>>FROM partmast 
>>>	LEFT JOIN partstats ON partmast.partnum=partstats.partnum 
>>>	LEFT JOIN (SELECT partnum, COUNT(invitems.invnum) AS Cnt
>>>                          FROM invitems where PartNum = '12345'
>>>                   GROUP BY partnum) invitems ON partmast.partnum=invitems.partnum
>>>WHERE partmast.partnum='12345' 
>>>ORDER BY partnum
>>>
>>>
>>>

BTW, we may want to add PartNum = '12345' condition into the derived table as well - see the change above.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform