Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi ,

In Sql Server 2000 I have a Log table "Logs" that conatins the fields

1. OrderNo

2. SequenceID

 

 

There is another table "Sequences" , that has the fields

1. SequenceID

2. DeliveryDate

 

In the Log table there can be multiple records for an Order with different SequenceID.

e.g.

 

OrderNo : SequenceID

_______ :___________

1 : 5

1 : 10

1 : 15

2 : 6

3 : 11

3 : 18

 

And the Sequences table is e.g.

 

SequenceID : DeliveryDate

__________ : ____________

5 : 02/01/2007

6 : 02/05/2007

10 : 02/10/2007

11 : 02/12/2007

15 : 02/13/2007

18 : 02/16/2007

 

 

 

Now each SequenceID corresponds to a DeliveryDate from the Sequences tabele

 

 

I want to create a query that will give me the Min(DeliveryDate) for each Order along with the corresponding SeqeunceID

 

So basically I want to know the earliest delivery date for an Order and the SequenceID to which this earliest delivery date corresponds to.

 

 

What will be the Query for this ???

 

Thanks

When you gotta go,you gotta go !!!!!!!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...