输入banner图图片脚本导航/分类

mysql sql语句修改某一字段下所有记录的大小写。

-*- coding: utf-8 -*- import pymysql db = pymysql.connect( host=127.0.0.1, db=weixin, user="root", password="1233211234567Aa*", charset=utf8, ) cursor = db.cursor(pymysql.cursors.DictCursor)#字典的形式获取数据 不写默认是元组 try: cursor.execute("update plugin set name=lower(name)")#把表plugin下name字段下所有的值改为小写。UCASE()为大写 except Exception, e: print e try: cursor.execute("select name from plugin")#字典的形式获取数据 不写默认是元组 data=cursor.fetchall() for i in data: print i[name] except Exception, e: print e db.commit() cursor.close() db.close()

 

mysql sql语句修改某一字段下所有记录的大小写。

标签:大小写   数据   import   imp   exce   word   use   mys   ctc