watsmyname Posted April 22, 2010 Share Posted April 22, 2010 Hello all, i dont know whether this type of issue has already been addressed or not, i would have searched but dont know the exact keyword to search. So i m posting it again.. my issue goes likes this. I have four (or even more) rows like this in my database table item_id date_payment item_type item_name 1234 2009-08-21 copy Copy name 1 1234 2009-12-23 copy Copy name 1 1234 2010-02-12 copy Copy name 1 1234 2010-04-21 copy Copy name 1 above 4 rows are identical except we have different date of payment. I want help on query that displays a row grouped to show single row with all the dates in comma separated form. For example i want to show result like this item_id date_payment item_type item_name 1234 2009-08-21 , 2009-12-23, 2010-02-12, 2010-04-21 copy Copy name 1 Can anybody help me please! Thanks a ton! Quote Link to comment https://forums.phpfreaks.com/topic/199370-querying-database-and-resulting-with-group-by/ Share on other sites More sharing options...
PFMaBiSmAd Posted April 22, 2010 Share Posted April 22, 2010 http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat Quote Link to comment https://forums.phpfreaks.com/topic/199370-querying-database-and-resulting-with-group-by/#findComment-1046349 Share on other sites More sharing options...
watsmyname Posted April 23, 2010 Author Share Posted April 23, 2010 Thanks mate, that is exactly what i needed...thanks a ton Quote Link to comment https://forums.phpfreaks.com/topic/199370-querying-database-and-resulting-with-group-by/#findComment-1046836 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.