syntax101 Posted December 6, 2007 Share Posted December 6, 2007 how do i select a data from the database without repeating the value to be stored ex JOBORDER NAME 1 A 1 A 1 A 2 A 3 B 4 C 2 A i want to select the JOBORDER DATA 1,2,3,4 without repeat the numbers just like above result JOBORDER 1 2 3 4 Quote Link to comment https://forums.phpfreaks.com/topic/80440-solved-help-with-mysql-query/ Share on other sites More sharing options...
rajivgonsalves Posted December 6, 2007 Share Posted December 6, 2007 use the DISTINCT keyword select DISTINCT fieldnames from tablename; Quote Link to comment https://forums.phpfreaks.com/topic/80440-solved-help-with-mysql-query/#findComment-407857 Share on other sites More sharing options...
syntax101 Posted December 6, 2007 Author Share Posted December 6, 2007 thanx a lot, i used group by but its more simplier if i use distinct Quote Link to comment https://forums.phpfreaks.com/topic/80440-solved-help-with-mysql-query/#findComment-407864 Share on other sites More sharing options...
fenway Posted December 6, 2007 Share Posted December 6, 2007 thanx a lot, i used group by but its more simplier if i use distinct And much better... don't ever use DISTINCT as a modifier to select, it's never what you want. Quote Link to comment https://forums.phpfreaks.com/topic/80440-solved-help-with-mysql-query/#findComment-407969 Share on other sites More sharing options...
syntax101 Posted December 6, 2007 Author Share Posted December 6, 2007 thanx a lot, i used group by but its more simplier if i use distinct And much better... don't ever use DISTINCT as a modifier to select, it's never what you want. what do you mean by never to use distinct as a modifier to select. sorry for that because i cannot understand it. im still a newbie Quote Link to comment https://forums.phpfreaks.com/topic/80440-solved-help-with-mysql-query/#findComment-407998 Share on other sites More sharing options...
fenway Posted December 6, 2007 Share Posted December 6, 2007 Just stick with group by and you'll always be fine... I'm actually going to be posting a sticky with a bunch of these types of things soon. Quote Link to comment https://forums.phpfreaks.com/topic/80440-solved-help-with-mysql-query/#findComment-408043 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.