Re: Oracle Beginner Help

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Mon, 16 Jan 2006 20:30:58 -0500
Message-ID: <XbOdnSsWF5xO1VHenZ2dnUVZ_vydnZ2d_at_comcast.com>


<stevenplewis_at_gmail.com> wrote in message news:1137389174.777650.71290_at_g49g2000cwa.googlegroups.com...
> I'm trying to display data for employees that have the job as a clerk
> and where hired before 1981. I write the following query
>
>
> select ename from emp where hiredate > ('01-JAN-81') and job = 'clerk';
>
> however it doesn't work. Any suggestions
>

in addiition to the other posts, string comparisons are case sensitive, so you need to know what case the data are stored in (in this sample data, it's upper case)

and use ANSI date literals for date comparison, it saves a lot of hassle (if you haven't downloaded the SQL manual yet from http://tahiti.oracle.com yet, now would be a good time to do so, and lookup the format for ANSI date literals)

and be more specific about 'doesn't work'. in this simple case, we can guess that 'doesn't work' means 'no rows returned', but as you progress to more difficult situations, you'll need to be more exact (including error messages)

++ mcs Received on Tue Jan 17 2006 - 02:30:58 CET

Original text of this message