mysql sql如何查询是否存在
SELECT COUNT(*) FROM xxx WHERE ID=xxx; if (x == 0) INSERT INTO xxx VALUES; else UPDATE xxx SET ;
SELECT information_schema.SCHEMATA.SCHEMA_NAME FROM information_schema.SCHEMATA where SCHEMA_NAME='databaseName';
SELECT DISTINCT t.table_name, n.SCHEMA_NAME FROM information_schema.TABLES t, information_schema.SCHEMATA n WHERE t.table_name = 'tableName' AND n.SCHEMA_NAME = 'databaseName';