RSS Forums RSS
Please support our MySQL advertiser: Programming Forums
Views: 3242 | Replies: 2 | Thread Tools  Display Modes
Join Date: Jun 2005
Posts: 39
Reputation: nephish is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
nephish nephish is offline Offline
Light Poster

need help with DISTINCT

  #1  
Jul 28th, 2005
Hey there,
i have a table in MySQL that is updated about every 5 minutes with about a hundred new records. For an application i am building, i only need the info from the most recent entry for each specific unit. But, i need all of the info in that row.

i was going to use DISTINCT like this,
SELECT DISTINCT UnitNumber FROM table ORDER BY `autoinc` DESC

it gives me only the last record for each unit, but only returns the UnitNumber and i need all of the colums for each UnitNumber that it gives me.

or if i use something like this, will it only pull out items that have only one entry of each?
select distinct UnitNumber, value1, value2 from table order by autoinc desc

or is there a better way?
thanks
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.



Similar Threads
Other Threads in the MySQL Forum
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 3:04 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC