Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Select union with empty rows
Message
 
 
To
08/08/2010 15:06:49
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Miscellaneous
Thread ID:
01474117
Message ID:
01475673
Views:
59
>>
>>Hah? How is it different from what I posted a week ago <B>Re: SQL Select union with empty rows</B> Message #1474131 ?
>
>
>**fabio solution
>select curOrdertype.cType;
>	, nvl(curOrder.nAmount,0) nAmount;
>	, curClient.id iClient;
>	, curClient.cName ;
>from curClient ;
>	join curOrdertype on .t.;
>	left join curOrder on curOrder.iOrderType = curOrdertype.id and curClient.id = curOrder.iClient ;
>	order by 3,4
>browse normal
>
>** solution Sergey
>select curOrdertype.cType ;
>	, cast(nvl(curOrder.nAmount, 0.00) as n(8,2)) as Amount ;
>	, curClient.cName;
>from curOrdertype, curClient ;
>	left join curOrder on curOrder.iOrderType = curOrdertype.id and curClient.id = curOrder.iClient ;
>	order by curClient.id, curOrdertype.id
>browse normal
>
>Sergey:
>Fabio selects from the table which has all the record (curClient) and joining all the records from the group table (curOrdettype)
>with a leftjoin of all the data (curOrder)
> i found this a very interesting solution, i was impressed and what is more it works perfectly.
>

You didn't even bother to read my message because it's not the query I suggested in it.
Here it's copied from my message
SELECT curClient.cName, CAST(NVL(curOrder.nAmount, 0.00) AS N(8,2)) AS Amount, curOrdertype.cType ;
	FROM curOrdertype FULL JOIN curClient ON .T. ;
		LEFT JOIN curOrder ON curOrder.iOrdertype = curOrdertype.ID ;
			AND curOrder.iClient = curClient.ID ;
	ORDER BY curClient.ID, curOrdertype.ID 		
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform