Jump to content

Archived

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

nysebamse

How to select unique data

Recommended Posts

Id like a query that only selects unique data, that is if the data exists in more than one row it will only select the first instance.

 

Is this possible?

 

Im planning to use this in a table that holds ip-adresses.

Share this post


Link to post
Share on other sites

Try this

 

select distinct * from table_name;

 

You can also refer the manual for more info.

Share this post


Link to post
Share on other sites

I dunno but wouldn\'t:

 


SELECT ip_address FROM table_name WHERE unique_column=\'$unique_user-inputted_variable\'

 

work? Hmm. Actually, I suppose it would only work if you were using a membership system and each person had their own id or something and they typed it in and it came up with their ip address.

Share this post


Link to post
Share on other sites

×

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.