Home » RDBMS Server » Server Administration » how to fix ora-936 and ora-908
how to fix ora-936 and ora-908 [message #373894] Wed, 16 May 2001 10:42 Go to next message
yen chew
Messages: 6
Registered: May 2001
Junior Member
I have been getting an missing expression and missing null key in the statment below. any help from the pros will be greatly appreciated.

select * from dssview.product_events where first_service_start_date >='01-jan-00' and <'01-jan-01' and product_no is 19 or 105 or 1915;

other than that if I run the query how can i export it to a text file or MS access table?

thanks.
Re: how to fix ora-936 and ora-908 [message #373895 is a reply to message #373894] Wed, 16 May 2001 12:37 Go to previous messageGo to next message
Andrew again...
Messages: 270
Registered: July 2000
Senior Member
select * from dssview.product_events where first_service_start_date >='01-jan-00' and <'01-jan-01' and product_no in (19, 105, 1915);

A further improvement is to explicitly concert datatypes (assumes the table column is DATE).
select * from dssview.product_events where first_service_start_date >=to_date('01-jan-00', 'dd-Mon-rr') and <to_date('01-jan-01', 'dd-Mon-rr') and product_no in (19, 105, 1915);

Remember that the date datatype can contain time. Also the time component in the dates above is at midnight on those dates, so somtimes you need to add 1 day to include that day.
Re: how to fix ora-936 and ora-908 [message #373907 is a reply to message #373894] Thu, 17 May 2001 01:54 Go to previous message
GIRIDHAR KODAKALLA
Messages: 92
Registered: May 2001
Member
Hai,
can u check at the product part of the query
"and product_no is 19 or 105 or 1915". I have a doubt here. Try to send the structure of the table as well as few records so that we can test it here.
Cheers,
Giridhar Kodakalla
Previous Topic: SQL query syntax
Next Topic: Re: Oracle Query - Mani
Goto Forum:
  


Current Time: Tue Jul 02 16:47:47 CDT 2024