| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| i want to access all the data in the row of min(time_value) and max(time_value) in a single query: below the sql i wrote but not working: select * from std_detail where time_value in ( select max(time_value),min(time_value) from std_detail) ---------------------------------------------------------------------- plz help me |
|
#2
|
| There are better ways but you need to give more information about your problem before I can give you the code. Here is one simple way to get your answer: SELECT std_detail.* FROM std_detail WHERE std_detail.time_value = (SELECT MAX(std_detail.time_value) FROM std_detail) OR std_detail.time_value = (SELECT MIN(std_detail.time_value) FROM std_detail); |
|
#3
| |
| Quote:
|
|
#4
|
| SELECT std_detail.* FROM std_detail WHERE std_detail.time_value = (SELECT MAX(std_detail.time_value) FROM std_detail) union SELECT std_detail.* FROM std_detail WHERE std_detail.time_value = (SELECT MIN(std_detail.time_value) FROM std_detail) |
![]() |
| Thread Tools | |
| Display Modes | |