nysebamse Posted September 23, 2003 Share Posted September 23, 2003 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. Quote Link to comment https://forums.phpfreaks.com/topic/1051-how-to-select-unique-data/ Share on other sites More sharing options...
shivabharat Posted September 23, 2003 Share Posted September 23, 2003 Try this select distinct * from table_name; You can also refer the manual for more info. Quote Link to comment https://forums.phpfreaks.com/topic/1051-how-to-select-unique-data/#findComment-3568 Share on other sites More sharing options...
Fyorl Posted September 23, 2003 Share Posted September 23, 2003 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. Quote Link to comment https://forums.phpfreaks.com/topic/1051-how-to-select-unique-data/#findComment-3575 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.