Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Aggregate Function Know-How Needed
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01442673
Message ID:
01442729
Views:
26
>>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform