Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select Sql - One Record , two records
Message
From
05/05/2003 13:23:47
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
05/05/2003 11:38:41
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00784975
Message ID:
00785033
Views:
16
This message has been marked as the solution to the initial question of the thread.
>Hi
>
>In one Table i have code , ValDeb N(10,2) , ValCre N(10,2)
>
>One record can have this
>
>Code1 , 50.00 , 20.00
>
>another example
>
>Code2 , 25.00 , 0.00
>
>I want make one select , where result is :
>
>Code1 , 50.00 , 0.00
>Code1 , 0 , 20.00
>Code2 , 25.00 , 0.00
>
>Do you understand ?
>
>Thanks
Select pkid, f1, f2*0 as f2 from myTable where f1 # 0  ;
 union ;
 Select pkid, f1*0 as f1, f2 from myTable where f2 # 0 ;
 order by 1,2 desc
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform