Posted by selectall on August 9, 2009
select stud_id , group_concat(paper_id) as i from tb
group by id
Original Table:
stud_id paper_id
1 1
1 2
1 3
1 4
2 2
2 3
3 1
4 2
Output:
stud_id paper_id
1 1,2,3,4
2 2,3
3 1
4 2
Posted in MS SQL 2005, Mysql Stuff | Tagged: concat multiple values of single column, concat values of single column in sql, creating a single field from multiple row results | Leave a Comment »
Posted by selectall on January 17, 2008
Confused by heading??? Yep, it’s true now LAMP become more powerful,it got wings of Sun

Sunmicrosystems accounced that company is going to accuire open source database giant Mysql, (that forms M of LAMP). Deal is settaled in $1 Billion in cash and assumed stock options.
MySQL is used by many of the web’s largest companies, including YouTube, Facebook, and Wikipedia. and this is one of the most popular open source web development stacks utilized by web sites today.
You can see found details about this news here on Sun Microsystems News Center
Posted in Mysql Stuff | Tagged: Mysql Acquisition, Select All, selectall, selectall.in, Sun & Mysql | Leave a Comment »
Posted by selectall on November 13, 2007
Normally we store data cobine values in different fields in database like First Name, Middle Name, Last Name. But while retriving data usually we wan’t to display data as a single string like display First Name, Middle Name, Last Name as a single string “User Name”.
To achive this output we concatinate all these sub values, some thing like this in PHP Read the rest of this entry »
Posted in Mysql Stuff, Mysql Tips | Tagged: Concatinate string, concat_ws, string function mysql | Leave a Comment »
Posted by selectall on November 12, 2007
By default Mysql store and returen ‘date’ data type values in “YYYY/MM/DD” format. So if we want to display date in different format then we have to format date values as per our requirement in scripting language.
Like in PHP if i want to display Date of Birth of student in “DD/MM/YYYY” format then i have to do something like this – Read the rest of this entry »
Posted in Mysql Stuff, Mysql Tips | Tagged: date format php, date_format, mysql date | Leave a Comment »