Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to combine two flds in one with on SQL Select?
Message
 
 
To
05/09/2005 15:51:57
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01046819
Message ID:
01046823
Views:
23
>>I have a table with the following fields (simplified):
>>(RES_DATE = Reservation date, RES_TIME = Reservation time)
>>
>>ROOM1 ROOM2 RES_DATE RES_TIME
>>A100 B200
>>C300
>>B200
>>A400 C300
>>B200
>>
>>I would like to create one cursor where there would be just one column ROOM and all reservations would be combined. For example:
>>
>>ROOM RES_DATE RES_TIME
>>A100
>>A400
>>B200
>>C300
>>and so on
>>
>>Is this possible in one SQL Select?
>>
>>Thank you.
>
>
>SELECT ROOM1 ROOM,RES_DATE,RES_TIME;
> FROM Table;
>UNION;
>SELECT ROOM2,RES_DATE,RES_TIME;
> FROM Table WHERE NOT ROOM2==""
>
Fabio,

Thank you very much for your help. I completely forgot about UNION.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform