mysql常用语句
2015-10-20 17:19
507 查看
1、用户A表的某一列更新B表的某一列
eg:用t2表的c_account_id替换t1表的c_counter_part_id字段
2、产生自增编号
rowNum将从1开始自增
eg:用t2表的c_account_id替换t1表的c_counter_part_id字段
update t_invest_account_cashflow t1 set t1.c_counter_part_id=(select t2.c_account_id from t_invest_account t2 where t1.c_invest_account_id=t2.c_invest_account_id )
2、产生自增编号
rowNum将从1开始自增
set @row=0; select c_account_cashflow_id ,@row:=@row+1 rowNum from t_account_cashflow where c_account_cashflow_id ;
相关文章推荐
- mysql explain 中type的归纳
- 【MySQL】【leetcode】 Employees Earning More Than Their Managers解题报告
- 【MySQL】【leetcode】 Duplicate Emails解题报告
- ubuntu mysql使用
- 新安装的Mysql5.5数据库使用mybatis提示插入数据成功并且主键已经自增,但是数据表中没有数
- mac下安装mysql5.6.27和MySQLWorkbench问题解决办法
- MYSQL数据库使用UTF-8中文编码乱码的解决办法
- Hibernate 因别名引起的Column Not Found(Mysql)
- vs2013添加mysql对EF的支持(转+说明)
- Mysql Exists 和Not Exists用法
- Mysql字符串字段判断是否包含某个字符串的3种方法
- mysql事务
- mysql ga rc beta alpha区别
- MySql常用的存储引擎
- mysql导入导出汇总
- 【MySQL】【leetcode】 Customers Who Never Order解题报告
- 用命令创建MySQL数据库(de1)
- 【MySQL】【leetcode】 Delete Duplicate Emails解题报告
- MySql--查询某字段相同数据的条数据
- mysql 数据表中查找重复记录