Archive for the ‘Mysql Stuff’ Category

Delete record from Master as well as Transaction, delete and inner join, inner join in delete

Use of Variable in sql query

Posted: August 6, 2010 in Mysql Stuff

Use of Variable in sql query, Variable in Query, value of one varialbe used in other query

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

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, [...]

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 [...]

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 [...]