随笔分类 -  MySql数据库及服务器

摘要:SQL Server 和 MySQL 中的 Date 函数 阅读全文
posted @ 2016-04-04 11:00 Xiao|Deng 阅读(261) 评论(0) 推荐(0)
摘要:重点研究查询数据,其他语句只做了解!!!"""一些最重要的 SQL 命令: select - 从数据库中提取数据 update - 更新数据 delete - 删除数据 insert - 插入数据 create database - 创建新数据库 alter database - 修改数据库 cre 阅读全文
posted @ 2016-04-04 10:50 Xiao|Deng 阅读(249) 评论(0) 推荐(0)
摘要:#python3 #xiaodeng #基于py3和pymysql查询某时间段的数据 import pymysql conn=pymysql.connect(user='root',passwd='root',host='localhost',db='test.db') cur=conn.cursor() '''【核心语句】''' cur.execute("select grage fr... 阅读全文
posted @ 2016-04-02 22:40 Xiao|Deng 阅读(3227) 评论(0) 推荐(0)
摘要:#python3 #xiaodeng #基于py3和pymysql的数据库查询,查询某几列的数据 import pymysql conn=pymysql.connect(....) cur=conn.cursor() cur.execute("select name,age from nlist") data=cur.fethall() for name,age in data: ... 阅读全文
posted @ 2016-04-02 22:18 Xiao|Deng 阅读(2384) 评论(0) 推荐(0)
摘要:#xiaodeng#python3#基于SQL和PYTHON的数据库数据查询语句import pymysql#1、基本用法cur.execute("select * from biao")#2、查询某表中的特定数据,如某制定id和名字的数据cur.execute("select * from bia 阅读全文
posted @ 2016-04-02 21:06 Xiao|Deng 阅读(2481) 评论(0) 推荐(0)
摘要:#xiaodeng #python 3 #数据库查询 #第一种方法(fethall,返回所有行数据) import pymysql #connect链接服务器,注意和服务库编码一致 conn=pymysql.connect(user,passwd,host,db,charset='utf8') #cursor链接数据库并用cur接收这个对象,然后便于调用方法(增、删、改、查4种方法) c... 阅读全文
posted @ 2016-04-02 20:26 Xiao|Deng 阅读(1322) 评论(0) 推荐(0)