Delete dups

T

tim.tait

I have a table that contains duplicate userids but each user id has
another set of information that is put with a priority. eg they say
their favourite colours are blue and red. blue has a high priority than
red so we say that blue is their favourite colour. i was just wondering
how i can go through and pick a userid and their favourite colour
according to which one has the highest priority.

an example of the table is (1 is the highest priority where 3 is the
lowest here)

user table colour table
userid colourcode colourid colour
priority
0001 33 33 blue
1
0001 22 22 red
2
0001 11 11 green
3
0002 22 22 red
2
0002 11 11 green
3

sorry if its a bit confusing any help would b greatly apriciated
 
T

tim.tait

hope this is better

user table colour table
userid colourcode colourid colour priority
0001 33 33 blue 1
0001 22 22 red 2
0001 11 11 green 3
0002 22 22 red 2
0002 11 11 green 3
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top