随笔分类 - MySql
摘要:like操作 1、百分号(%)通配符 在搜索串中,%表示任何字符出现的任意次数。 select nickname, username,email from t_user where email like "%qq.com"; "%qq.com"表示匹配email中以qq.com结尾的邮箱,%可以代表
阅读全文
摘要:组合where子句 and操作符 select id,content,nickname from t_comment where id<11 and id>2; select id,content,nickname,blog_id from t_comment where id>11 and blo
阅读全文
摘要:在select语句中,数据根据where子句中指定的搜索条件进行过滤 where子句操作符: 操作符描述 = 等于 <> 不等于 > 大于 < 小于 >= 大于等于 <= 小于等于 BETWEEN 在某个范围内 LIKE 搜索某种模式 select title, create_time from t
阅读全文
摘要:为了使用select检索数据,必须至少给出两条信息 想选择什么,从什么地方选择 索引单个列 select title from t_blog; 检索多个列 select title,flag,create_time from t_blog; 检索所有列 select * from t_blog; 检
阅读全文
摘要:python连接MySQL数据库:pymysql # 测试操作 import pymysql # 打开数据库 db = pymysql.connect("localhost", "root", "test1234", "pythontest", charset='utf8' ) # 使用cursor
阅读全文
摘要:恢复内容开始 回顾数据库的一些简单的增删查改的操作语法与注意点,来自菜鸟教程https://www.runoob.com/mysql/mysql-tutorial.html 关于数据库的操作 关于表的操作 创建表: 删除表 添加数据 查询数据 你可以使用星号(*)来代替其他字段,SELECT语句会返
阅读全文

浙公网安备 33010602011771号