x

How to get the distinct data from group of Data?

Hi to all

I've the Record like

SNO

 2
 3
 5
 10
 29
 43
 74
 1
 
 
 ----------
 PICKUP_STAGE
 6
 16
 80
 9
 6
 5
 7
 10
 
 
 ----------
 DROP_STAGE 
 6
 16
 0
 9
 0
 5
 7
 10
 
 
 ----------
 PICKUP_TRIP
 2
 2
 2
 1
 2
 2
 1
 2
 
 
 ----------
 DROP_TRIP 
 3
 3
 3
 4
 3
 3
 4
 3

Here i could not post data in table so that i post like this.

Here i've to get the data based on trip distinct. for example pickup_trip 2 has repeated pickup stage 6.

I've to get the only one 6 pickup_stage with other distinct stage to that particular pickup_trip

Please Help me

Thanks to all

more ▼

asked Oct 12, 2011 at 11:04 PM in Default

avatar image

varun 1
22 8 8 10

Are these separate tables or different columns within the same table?

If they are columns, which row with PICKUP_STAGE 6 should I throw out?

If they are tables, I can guess from you description that the first row in PICKUP_TRIP goes with the first row in PICKUP_STAGE but I don't know for certain that would be correct, and it certainly can't be acted upon programmatically since data order is not guaranteed.

Oct 12, 2011 at 11:33 PM KenJ
(comments are locked)
10|1200 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x1014
x748

asked: Oct 12, 2011 at 11:04 PM

Seen: 804 times

Last Updated: Oct 12, 2011 at 11:24 PM

Copyright 2016 Redgate Software. Privacy Policy