Home » SQL & PL/SQL » SQL & PL/SQL » A Problem with using MAX function, please help
A Problem with using MAX function, please help [message #215340] Sun, 21 January 2007 11:40 Go to next message
Kingdog
Messages: 5
Registered: December 2006
Junior Member
I'm trying to write a query to find the longest duration of a booking. Whenever I run this query, the result is "no rows
selected" but I'm sure there is a longest duration of booking in the data. Can somebody give me some help?

This is my query:


SELECT Date, (EndTime-StartTime)
FROM booking
WHERE (EndTime-StartTime)=(SELECT MAX(EndTime-StartTime) FROM booking);
Re: A Problem with using MAX function, please help [message #215342 is a reply to message #215340] Sun, 21 January 2007 11:44 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>Can somebody give me some help?
It is bad SQL coding practice to rely on implicit data type conversion(s).
Post results from
SQL DESC BOOKING
Previous Topic: Table creation help !!
Next Topic: how 2 store images in oracle 9i
Goto Forum:
  


Current Time: Tue Dec 03 09:34:52 CST 2024