Delete record from Master as well as Transaction, delete and inner join, inner join in delete
Archive for the ‘Mysql Stuff’ Category
Use of Variable in sql query, Variable in Query, value of one varialbe used in other query
Creating a single field from multiple row results
Posted: August 9, 2009 in MS SQL 2005, Mysql StuffTags: concat multiple values of single column, concat values of single column in sql, creating a single field from multiple row results
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
Mysql Got Power Of Sun…
Posted: January 17, 2008 in Mysql StuffTags: Mysql Acquisition, Select All, selectall, selectall.in, Sun & Mysql
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, [...]
Concatinate fields in mysql query
Posted: November 13, 2007 in Mysql Stuff, Mysql TipsTags: Concatinate string, concat_ws, string function mysql
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 [...]
Format date values in mysql query
Posted: November 12, 2007 in Mysql Stuff, Mysql TipsTags: date format php, date_format, mysql date
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 [...]