sqlite匹配,
# coding:utf-8 import sqlite3 # like: 主要是用于匹配数据库中的多条记录。 # a%: 匹配以a开头的数据 # %a: 以a结尾的数据 # %a%: 数据中包含a字符的数据 # a_:匹配以a开头,并且仅匹配a后一个字符的数据 connect = sqlite3.connect('database.db') cursor = connect.cursor() sql = "select * from Student where name like '张_'" res = cursor.execute(sql) for id, name, score, age in res: print(id, name, age, score)
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。