How can I return pivot table output in MySQL?

This basically is a pivot table. A nice tutorial on how to achieve this can be found here: http://www.artfulsoftware.com/infotree/qrytip.php?id=78 I advise reading this post and adapt this solution to your needs. Update After the link above is currently not available any longer I feel obliged to provide some additional information for all of you searching … Read more

STRING_SPLIT in MySql- how to do it?

Fix your data model! Don’t store multiple values in a single column. Learn proper SQL syntax! Never use commas in the FROM clause. Always use proper, explicit, standard JOIN syntax. With that said, you don’t need to split the string. You can use string operations: AND CONCAT(‘-‘, eo.photosId, ‘-‘) LIKE CONCAT(‘%-‘, er.pNumber, ‘-%’) But you … Read more

When to use single quotes, double quotes, and backticks in MySQL

Backticks are to be used for table and column identifiers, but are only necessary when the identifier is a MySQL reserved keyword, or when the identifier contains whitespace characters or characters beyond a limited set (see below) It is often recommended to avoid using reserved keywords as column or table identifiers when possible, avoiding the … Read more