MySQL中NOT LIKE的正确语法是什么?
以下是MySQL中NOTLIKE的correcrt语法:
SHOW TABLES WHERE `TABLES_IN_yourDatabaseName` NOT LIKE ‘yourTableName%’;
为了理解上述语法,我们将使用具有一些表的数据库SAMPLE。首先,我们将显示示例数据库的所有表。之后,我们将使用上面的语法。
查询如下以显示所有表。首先使用USE命令将数据库切换到SAMPLE:
mysql> USE SAMPLE; Database changed
显示数据库中的所有表。查询如下:
mysql> show tables;
以下是输出:
+--------------------------+ | Tables_in_sample | +--------------------------+ | blobsizedemo | | insert_prevent | | insertrecord_selecttable | | insertrecordprevent | | mytable | | newlinedemo | | notequaloperator | | sumofeverydistinct | | yourtable | +--------------------------+ 9 rows in set (0.00 sec)
现在,您可以使用上述语法来检查所有没有文本“插入”的表名。查询如下:
mysql> show tables where `TABLES_IN_sample` NOT LIKE 'insert%';
以下是输出:
+--------------------+ | Tables_in_sample | +--------------------+ | blobsizedemo | | mytable | | newlinedemo | | notequaloperator | | sumofeverydistinct | | yourtable | +--------------------+ 6 rows in set (0.00 sec)
热门推荐
10 新年门口花束祝福语简短
11 盘锦结婚祝福语大全简短
12 父母生日祝福语 简短独特
13 家庭恩爱祝福语简短英文
14 高考俄语祝福语大全简短
15 虎年祝福语 诗句唯美简短
16 生日婚礼祝福语简短精辟
17 虎年喝酒拜年祝福语简短
18 教师闺蜜祝福语简短