SQL: union operator

An UNION operator must have an equal number of columns in the SELECT: (SELECT *, t.table_id, t.title, t.description FROM TABLE t LEFT JOIN jointable jt ON t.table_id=jt.table_id WHERE t.status=1 GROUP BY t.table_id ORDER BY description) UNION (SELECT *, t.table_id, t.title, t.description FROM TABLE t LEFT JOIN jointable jt ON t.table_id=jt.table_id WHERE t.user_id=1)(SELECT *, t.table_id, t.title,
Continue reading SQL: union operator

Chive: web-based MySQL management

Note: Chive is no longer actively developed / maintained! Chive is a next generation open source MySQL database management tool. The web-based user interface supports most of the common operations needed by software developers and database admins. Build in PHP, based on top of the Yii framework. Create, alter and browse Database Table Routines Trigger
Continue reading Chive: web-based MySQL management

MySQL 5.0.12: join processing changes

Beginning with MySQL 5.0.12, natural joins and joins with USING, including outer join variants, are processed according to the SQL:2003 standard. The goal was to align the syntax and semantics of MySQL with respect to NATURAL JOIN and JOIN … USING according to SQL:2003. However, these changes in join processing can result in different output
Continue reading MySQL 5.0.12: join processing changes

(My)Sql statements

Find records in table Orphan that don’t exist in table OrphanRef: SELECT * FROM Orphan LEFT JOIN OrphanRef ON OrphanRef.Id=Orphan.Id WHERE ISNULL(OrphanRef.Id) Delete records in table¬†Orphan that don’t exist in table OrphanRef: DELETE Orphan FROM Orphan LEFT JOIN OrphanRef ON OrphanRef.Id=Orphan.Id WHERE ISNULL(OrphanRef.Id) Check on a NULL value: SELECT * FROM tbl_name WHERE col_name IS
Continue reading (My)Sql statements