Gossamer Forum
Home : General : Databases and SQL :

Format for DISTINCT, and grabbing ALL values..

Quote Reply
Format for DISTINCT, and grabbing ALL values..
Hi guys/gals,

I'm basically trying to do a DISTINCT select on a table.

The table contains;

ID | Username | SubmittedSiteFrom

Basically, I need to grab a list of UNIQUE usernames from this table. This works;

SELECT DISTINCT(Username) FROM lsql_
UserCreditTrack

However, this only gives access to "Username!", and not "SubmittedSiteFrom". Is there any way to specify that I want to import the SubmittedSiteFrom value too, into the hashref?

I've tried everything I can think of... but nothing will work :(

TIA

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] Format for DISTINCT, and grabbing ALL values.. In reply to
What about this?

SELECT DISTINCT(Username),SubmittedSiteFrom FROM lsql_UserCreditTrack
Quote Reply
Re: [Gmail] Format for DISTINCT, and grabbing ALL values.. In reply to
Hi,

Thanks for the reply.. it works :) I'm not quite sure what was going on, but I'm 99% sure I already tried that format. I guess I didn't Unsure

Thanks again.

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Gmail] Format for DISTINCT, and grabbing ALL values.. In reply to
Code:
SELECT DISTINCT Username ,SubmittedSiteFrom FROM lsql_UserCreditTrack

this would only display rows where all of the columns are distinct, not just username.