Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL related query
Message
From
04/03/2002 06:47:04
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
04/03/2002 06:31:08
Rahul Murarka
Sys-Con Engineering
Kolkata, India
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00627701
Message ID:
00627708
Views:
11
>Dear Sir/madam
>
>Please Advise
>
>There is a table for addbook
>name
>PADD1
>PADD2
>PCITY
>PSTATE
>TADD1
>TADD2
>TCITY
>TSTATE
>group
>
>Option for Temporary Address & Permanent address
>In printout We print all or by state. If state in there in permanent add
>or temporary add it should be printed out.
>
>eg. address1 address1
> address2 address2
> city city
> Pstate tstate
>
>But if both address are same then only one of them should be printed out.
>If one is blank the obviusly other should be printed out.
>
>
>I tried SQL with union but I didn't get the req result

select padd1 as address1, padd2 as address2, pcity as city, pState as state ;
from myTable where !empty(pState) ;
union ;
select tadd1 as address1, tadd2 as address2, tcity as city, tState as state ;
from myTable where !empty(tState) ;
into cursor myCursor

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
Next
Reply
Map
View

Click here to load this message in the networking platform