随笔分类 -  mysql

摘要:通配符:用来匹配值的一部分的特殊字符 为在搜索子句中使用通配符,必须使用LIKE操作符,like指示mysql,后跟的搜索模式利用通配符匹配而不是直接相等匹配进行比较。 %通配符 %表示任何字符出现的任意次数 select prod_id,prod_name from products where 阅读全文
posted @ 2023-06-14 16:25 99号的格调 阅读(19) 评论(0) 推荐(0) 编辑
摘要:select prod_id,prod_name,prod_price from products where vend_id = 1003 and prod_price <= 10; 输出结果: + + + + | prod_id | prod_name | prod_price | + + + 阅读全文
posted @ 2023-06-11 21:45 99号的格调 阅读(11) 评论(0) 推荐(0) 编辑
摘要:关键字:where 这里只说明不匹配的用法,其他的较为简单,不予叙述。 select vend_id,prod_name from products where vend_id <> 1003; 输出结果: + + + | vend_id | prod_name | + + + | 1001 | . 阅读全文
posted @ 2023-06-09 15:56 99号的格调 阅读(22) 评论(0) 推荐(0) 编辑
摘要:重点关键字:order by 排序单列数据: select prod_name from products order by prod_name; 输出结果: + + | prod_name | + + | .5 ton anvil | | 1 ton anvil | | 2 ton anvil | 阅读全文
posted @ 2023-06-09 15:36 99号的格调 阅读(8) 评论(0) 推荐(0) 编辑
摘要:首先给出本次教程需要用到的数据表的内容:products + + + + + + | prod_id | vend_id | prod_name | prod_price | prod_desc | + + + + + + | ANV01 | 1001 | .5 ton anvil | 5.99 | 阅读全文
posted @ 2023-06-08 19:50 99号的格调 阅读(16) 评论(0) 推荐(1) 编辑

点击右上角即可分享
微信分享提示