|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
select a data Between dates, second dat is optional or today
Hello,
I have query select table1.* from table1, table2 where table1.pid = table2.id and table1.date between table2.startdate and table2.enddate however, it returns no rows often. reason for this is dat table2.enddate is empty when something has not finished. Therefor I need to use TODAY if the field is empty. Is there any possibilty to do this within the query? thanks advance |
|
#2
|
|||
|
|||
|
Try NVL
Code:
select table1.*
from table1, table2
where table1.pid = table2.id and
table1.date between
table2.startdate and NVL(table2.enddate, SYSDATE);
|
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > select a data Between dates, second dat is optional or today |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|