Web Wiz - Solar Powered Eco Web Hosting

  New Posts New Posts RSS Feed - SQL DISTINCT stuff
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedSQL DISTINCT stuff

 Post Reply Post Reply Page  <123
Author
Bunce View Drop Down
Senior Member
Senior Member
Avatar

Joined: 10 April 2002
Location: Australia
Status: Offline
Points: 846
Direct Link To This Post Posted: 13 February 2003 at 5:54pm

But you see its not necessarily in entry order.

What you are getting is the lowest ID for EACH group of categories, which in this case may be the earliest entry for each category.

You have to remember that once you GROUP by a value then you are summarising all records for that group into a SINGLE record. So by grouping by Category, you need to work out what you want to do with any other fields you wish to summarise.

In this case weve taken a MINIMUM of all the ID's for each group, and sorted by this.

Personally, I would be adding a 'Date Created' field and using this as it's more meaningful that using the ID.

Hope this makes it a little clearer.

Cheers,
Andrew

There have been many, many posts made throughout the world...
This was one of them.
Back to Top
snooper View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 23 April 2002
Location: Israel
Status: Offline
Points: 333
Direct Link To This Post Posted: 13 February 2003 at 6:22pm

ok, i do get it now.
thanks for the clear explanation, and again for the solution

:)
sn

Back to Top
jaz9090 View Drop Down
Groupie
Groupie


Joined: 25 October 2002
Location: United Kingdom
Status: Offline
Points: 135
Direct Link To This Post Posted: 14 February 2003 at 6:19am
Originally posted by MorningZ MorningZ wrote:

you're not advancing much as a programmer
You might as well have been calling him a bad programmer
Back to Top
jaz9090 View Drop Down
Groupie
Groupie


Joined: 25 October 2002
Location: United Kingdom
Status: Offline
Points: 135
Direct Link To This Post Posted: 14 February 2003 at 6:20am
Just in different words
Back to Top
 Post Reply Post Reply Page  <123

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.07
Copyright ©2001-2024 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Policy

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2024 Web Wiz Ltd. All rights reserved.