|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
A tricky SQL-question in Access 97
Hi
I wonder if anyone can help me with this? I have a table with two columns. CustomerNumber and OrderNumber. For each Customernumber there is many OrderNumber like this: 81200 3389 81200 3478 81200 3542 81300 3390 81300 3491 81500 3391 81500 3492 What i want to find out with a SQL-question is the highest OrderNumber for each CustomerNumber so the table will look like this after that: 81200 3542 81300 3491 81500 3492 If there is anyone who know the solution I will be very glad Best Regards //Tobias |
|
#2
|
||||
|
||||
|
Code:
select CustomerNumber, OrderNumber
from yourtable AA
where OrderNumber =
( select max(OrderNumber)
from yourtable
where CustomerNumber = AA.CustomerNumber
)
http://r937.com/ |
|
#3
|
|||
|
|||
|
That works fine
Thank you Rudy for your help
|
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > A tricky SQL-question in Access 97 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|