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
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
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
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:
> > >>
> > >
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
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
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
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:
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
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
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
11 matches
Mail list logo