|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
2 Query questions
Problem one:
How do I get the maximum of a single column? I know about SELECT MAX(ColumnName) FROM Whatever, but what If I also want to slect another attribute from the same row? and Problem two: How do I combine all data from two seperate views? Not like the usual joins, but the views have the same attributes and I wish one to follow on (in the same veiw) from the other... I hpe someone can understand what I'm saying and is able to help... |
|
#2
|
|||
|
|||
|
Code:
select c1 ,c2 from t where c1 in (select max(c1) from t) Code:
select v1c1,v1c2 from v1 union all select v2c1,v2c2 from v2 |
|
#3
|
|||
|
|||
|
Quote:
Another solution: Code:
SELECT col1, (select max(col2) from table), col3 FROM table |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > 2 Query questions |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|