Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 1st, 2012  |  syntax: None  |  size: 1.00 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. MySQL: union query fails on MySQL 5.5, works on MySQL 5.1
  2. SELECT information_schema.tables.table_name, schema_tables.db_table, schema_tables.ne_page
  3.   FROM information_schema.tables
  4.   LEFT JOIN (
  5.     (SELECT DISTINCT db_table, ne_page FROM {$db}.nexedit_schema)
  6.     AS schema_tables)
  7.   ON (schema_tables.db_table = information_schema.tables.table_name
  8.     COLLATE utf8_unicode_ci)
  9.   WHERE information_schema.tables.table_schema = '{$db}'
  10.     AND information_schema.tables.table_name NOT LIKE 'nexedit_%'
  11.  
  12. UNION
  13.  
  14. SELECT information_schema.tables.table_name, schema_tables.db_table, schema_tables.ne_page
  15.   FROM information_schema.tables
  16.   RIGHT JOIN (
  17.     (SELECT DISTINCT db_table, ne_page FROM {$db}.nexedit_schema)
  18.     AS schema_tables)
  19.   ON (schema_tables.db_table = information_schema.tables.table_name
  20.     COLLATE utf8_unicode_ci)
  21.   WHERE information_schema.tables.table_schema IS NULL
  22.     AND schema_tables.db_table NOT LIKE 'nexedit_%'
  23.  
  24. GROUP BY information_schema.tables.table_name,schema_tables.db_table;