|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Union and rownum
Hi,
I created a new table with two column: ID and description. I want to feel the description with this query: SELECT DISTINCT departure FROM tabTravels WHERE departure IS NOT NULL UNION SELECT DISTINCT arrival FROM tabTravels WHERE arrival IS NOT NULL How can I select a unique ROWNUM from this query (for the ID field)? |
|
#2
|
||||
|
||||
|
If someone is interested, I found the solution:
SELECT ROWUM id, departure FROM ( SELECT departure FROM tabTravels WHERE departure IS NOT NULL UNION SELECT arrival FROM tabTravels WHERE arrival IS NOT NULL ) |
|
#3
|
|||
|
|||
|
that will do the job, but some extra processing. Thanks for sharing.
|
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > Union and rownum |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|