Jump to content

DISTINCT or GROUP BY


sphinx9999

Which is best to use when extracting one column, DISTINCT or GROUP BY?  

5 members have voted

  1. 1. Which is best to use when extracting one column, DISTINCT or GROUP BY?

    • Distinct
      1
    • Group by
      1
    • No difference
      3


Recommended Posts

Which do you think is better, DISTINCT or GROUP BY?

SELECT DISTINCT id FROM phrase WHERE campaign LIKE 'proper%'

or

SELECT id FROM phrase WHERE campaign LIKE 'proper%' GROUP BY advert_id

I've asked this question before and received the following answer from a reliable source: "When there's just one column it doesn't matter". Do you agree?

Link to comment
https://forums.phpfreaks.com/topic/91044-distinct-or-group-by/
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 4 months later...

Archived

This topic is now archived and is closed to further replies.

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