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

varun 1 gravatar image

varun 1
22 7 8 9

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.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

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:

x712
x577

asked: Oct 12, 2011 at 11:04 PM

Seen: 594 times

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