taith Posted May 15, 2007 Share Posted May 15, 2007 ok... heres what i'm trying to do... 1) i have a database divinelive_messages table with a sessid column 2) i need to find out rows from the database, which only show that sessid in there once any ideas? Link to comment https://forums.phpfreaks.com/topic/51472-solved-mysql-query/ Share on other sites More sharing options...
stevesimo Posted May 15, 2007 Share Posted May 15, 2007 You can use the SQL statement Distinct so that only 1 instance of each ID is selected ie. Select Distinct sessidfield from divinelive_messages Hope this helps Steve Link to comment https://forums.phpfreaks.com/topic/51472-solved-mysql-query/#findComment-253456 Share on other sites More sharing options...
taith Posted May 15, 2007 Author Share Posted May 15, 2007 ya... but that would give me 1 of everything... i only want ones that are only in there once... if its more, scratch if off the list... Link to comment https://forums.phpfreaks.com/topic/51472-solved-mysql-query/#findComment-253465 Share on other sites More sharing options...
stevesimo Posted May 15, 2007 Share Posted May 15, 2007 Am not sure on the exact usage but something like this might work ie. Select sessidfield from divinelive_messages Where COUNT(sessidfield) = 1 Link to comment https://forums.phpfreaks.com/topic/51472-solved-mysql-query/#findComment-253467 Share on other sites More sharing options...
jitesh Posted May 15, 2007 Share Posted May 15, 2007 Select sessidfield from divinelive_messages group by sessidfield having count(sessidfield) = 1 Link to comment https://forums.phpfreaks.com/topic/51472-solved-mysql-query/#findComment-253470 Share on other sites More sharing options...
taith Posted May 15, 2007 Author Share Posted May 15, 2007 sweet thanks! Link to comment https://forums.phpfreaks.com/topic/51472-solved-mysql-query/#findComment-253475 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.