Re: SQL statement.

2002-02-26 Thread daniel
Well you are going to have to use group by and a decode statement. You want the actual sql statement why do u not go ask someone in a sql group. but something like SELECT MAX(OrderNum),requstID FROM TRequest group by requestID,OrderNum might work. dont know if this works but hey did it in 10

Re: SQL statement.

2002-02-24 Thread Next Step
At 09:12 AM 2/25/2002 +0530, you wrote: >This should work: > >SELECT requestID, OrderNum, SalesName FROM tHWRequestApprover a >where >OrderNum = ( select max(b.OrderNum) from tHWRequestApprover b where >b.requestID= a.requestIDgroup by b.requestID) Thanks vibha, It works!! Cheers, /NS

Re: SQL statement.

2002-02-24 Thread Vibha Jindal
lt;[EMAIL PROTECTED]> Sent: Saturday, February 23, 2002 9:41 AM Subject: Re: SQL statement. > At 09:13 AM 2/23/2002 +0700, you wrote: > >At 01:43 PM 2/21/2002 -0500, you wrote: > >>Try this: > >> > >>SELECT RequestID FROM TRequest > >>WHERE OrderN

Re: SQL statement.

2002-02-24 Thread Vibha Jindal
ED]> > To: <[EMAIL PROTECTED]> > Sent: Saturday, February 23, 2002 9:41 AM > Subject: Re: SQL statement. > > > > At 09:13 AM 2/23/2002 +0700, you wrote: > > >At 01:43 PM 2/21/2002 -0500, you wrote: > > >>Try this: > > >> > > >

Re: SQL Statement

2002-02-24 Thread Vibha Jindal
This should work: SELECT requestID, OrderNum, SalesName FROM tHWRequestApprover a where OrderNum = ( select max(b.OrderNum) from tHWRequestApprover b where b.requestID= a.requestIDgroup by b.requestID) Regards, Vibha ==To

Re: SQL statement.

2002-02-22 Thread Next Step
At 09:13 AM 2/23/2002 +0700, you wrote: >At 01:43 PM 2/21/2002 -0500, you wrote: >>Try this: >> >>SELECT RequestID FROM TRequest >>WHERE OrderNum = (SELECT MAX(OrderNum) FROM TRequest); > >It will only retrieve *one* record which has highest OrderNum. >What i want is to retrieve *every* unique Req

Re: SQL statement.

2002-02-22 Thread Next Step
At 01:43 PM 2/21/2002 -0500, you wrote: >Try this: > >SELECT RequestID FROM TRequest >WHERE OrderNum = (SELECT MAX(OrderNum) FROM TRequest); It will only retrieve *one* record which has highest OrderNum. What i want is to retrieve *every* unique RequestID which has highest OrderNum, say for REQ1

Re: SQL statement.

2002-02-21 Thread Joe Cheng
Try this: SELECT RequestID FROM TRequest WHERE OrderNum = (SELECT MAX(OrderNum) FROM TRequest); === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body:

Re: SQL statement.

2002-02-21 Thread Branden Root
Of Next Step Sent: Thursday, February 21, 2002 4:51 AM To: [EMAIL PROTECTED] Subject: OOT: SQL statement. Hi, I have one table, say TRequest which has : UID RequestID OrderNum SalesName - +---+---+ 1001 REQ11 III 1002 REQ21

Re: OOT: SQL statement.

2002-02-21 Thread Clayton Nash
select requestID from trequest where ordernum=max(ordernum); This assumes that by highest you mean the highest alphabetically. Clayton - Original Message - From: "Next Step" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 21, 2002 12:5

OOT: SQL statement.

2002-02-21 Thread Next Step
Hi, I have one table, say TRequest which has : UID RequestID OrderNum SalesName +---+---+ 1001 REQ11 III 1002 REQ21 UUU 1003 REQ22 TTT 1004 REQ31 XXX 1005 REQ41