Jump to content

Select a distinct pair of fields?


Switch0r

Recommended Posts

Hey peeps, was wondering if anyone can help me. I'm trying to get a list of all distinct field pairs from a table i have (the table is listing artists in a cd collection if that makes any difference) and i have the first and second names that i want to get distinct values of.

essentially i want to select a distinct pair of first and last, rather than just distinct last, as there may be crossover of the 2 names.

eg:

jeff buckley
tim buckley

i want to select a distinct pair rather than just the last name

any ideas?
Link to comment
Share on other sites

[quote author=fenway link=topic=111124.msg450175#msg450175 date=1160514295]
DISTINCT is _not_ a function!  It is a modifier to SELECT, not to any of the columns.  Generally, I use GROUP BY when I actually want to group things, and DISTINCT for uniqueness.
[/quote]

fenway, i think i'm lost here. did i say something to instigate this argument about it being a function? i hope i didn't imply that it was :P
Link to comment
Share on other sites

[quote author=obsidian link=topic=111124.msg450433#msg450433 date=1160572132]
fenway, i think i'm lost here. did i say something to instigate this argument about it being a function? i hope i didn't imply that it was :P
[/quote]

Sorry about that, obsidian... I should have quoted this:
[quote author=Switch0r link=topic=111124.msg450160#msg450160 date=1160512221]
doesn't that just select a distinct last name and a 'whatever' first name though?
[/quote]

That's what triggered my response; your answer was entirely correct.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.