SQL QUERY HELP

2001-04-05 Thread Seema Singh
Hi Gurus I have following data in table emp empcode empname SAL a001 X 2000 b001 Y 4000 c001 A 5000 d001 C 8000 If sal is >=5000 there will be another columns grade and print A else B The outout would be like empcode empname SALGrade a001

SQL Query Help

2003-05-29 Thread Basavaraja, Ravindra
i have a query that returns 2 rows with one column being id and the other being date-time stamp. i want to select the row with the latest timestamp among those two records.they have difference id values SELECT ID,LastModDate FROM Tab ID LastModDate -- --- 2 1/20/2003 2:

SQL Query Help

2003-06-13 Thread Basavaraja, Ravindra
I have a table with records like this CID S TO_CHAR(DATECREATED, MESSAGE PID - - -- 2 N 01-feb-1974 19:45:45 service change1* 3 N 01-feb-1974 19:45:45 service change

RE: SQL QUERY HELP

2001-04-05 Thread Jacques Kilchoer
Title: RE: SQL QUERY HELP > -Original Message- > From: Seema Singh [mailto:[EMAIL PROTECTED]] > > I have following data in table emp > empcode  empname   SAL > a001 X 2000 > b001 Y 4000 > c001 A 5000 > d001 C 

Re: SQL QUERY HELP

2001-04-05 Thread Allan Davis Sahadeo
Try this. select empcode, empname, sal, decode(to_char(trunc((nvl(sal,0)+1)/5001)),'0','A','B') NewCol from emp / - Original Message - To: "Multiple recipients of list ORACLE-L" <[EMAIL PROTECTED]> Sent: Thursday, April 05, 2001 1:40 PM > Hi Gurus > I have following data in tabl

RE: SQL Query Help

2003-05-29 Thread Murray, Margaret
Add "group by ID;" as in: SELECT ID,MAX(LastModDate) FROM Tab group by ID; > -Original Message- > From: Basavaraja, Ravindra [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 28, 2003 8:15 PM > To: Multiple recipients of list ORACLE-L > Subject: SQL Query He

Re: SQL Query Help

2003-05-29 Thread Reginald . W . Bailey
cc: [EMAIL PROTECTED] Subject: SQ

RE: SQL Query Help

2003-05-29 Thread Basavaraja, Ravindra
5 PM > To: Multiple recipients of list ORACLE-L > Subject: SQL Query Help > > > i have a query that returns 2 rows with one column being id > and the other > being date-time stamp. > > i want to select the row with the latest timestamp among those two > reco

RE: SQL Query Help

2003-05-29 Thread Basavaraja, Ravindra
IL PROTECTED] Sent by: cc: [EMAIL PROTECTED] Subject: SQ

Re: SQL Query Help

2003-05-29 Thread Daniel W. Fink
roup by ID; -Original Message- From: Basavaraja, Ravindra [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 8:15 PM To: Multiple recipients of list ORACLE-L Subject: SQL Query Help i have a query that returns 2 rows with one column being id and the other being date-time stamp. i want to sele

Re: SQL Query Help

2003-05-29 Thread Mark Richard
Sent by: Subject: Re: SQL Query Help

Re: SQL Query Help

2003-06-13 Thread Wolfgang Breitling
select from A) where and datecreated = (select min(datecreated) from b where b.cid = a.cid and b.pid = a.pid) At 08:14 PM 6/13/2003 -0800, you wrote: I have a table with records like this CID S TO_CHAR(DATECREATED, MESSAGE PID - - ---