![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, If I do : (select 0, c.* from table1 c minus select distinct 0, a.* from table1 a,table2 b where ... ) union select distinct 1, a.* from table1 a, table2 b where ... it works fine. But if I want to add "order by" and any column from table1 I get "ORA-00904 invalid column name" I don't understand :-( Thanks in advance for any idea... |
#3
| |||
| |||
|
|
1) post the statement that causes the error 2) you probably need to order by column position, not column name, since you're using set operators |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
Try using the whole thing as a subquery and wrapping one more query around it, with the order by clause in the outer query, and just using the column name in the order by clause without prefacing it with a table name, as demonstrated below. |
![]() |
| Thread Tools | |
| Display Modes | |
| |