Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL related query
Message
De
04/03/2002 06:47:04
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
04/03/2002 06:31:08
Rahul Murarka
Sys-Con Engineering
Kolkata, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00627701
Message ID:
00627708
Vues:
12
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform