x
login about faq Site discussion (meta-askssc)

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 '11 at 11:04 PM in Default

varun 1 gravatar image

varun 1
21 5 7 8

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 '11 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



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x599
x394

asked: Oct 12 '11 at 11:04 PM

Seen: 308 times

Last Updated: Oct 12 '11 at 11:24 PM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.