mysql笔记

针对之前工作中用到的mysql基本知识的整理,这里只写一些实例:

(1)alert添加字段:语法:alert table tablename add colummname datatype [default];其中default可选

alter table  TN_APPLICATION add checkCodeyear number(4) default 2017;

(2)

update TN_APPLICATION set checkCodeyear=to_number(to_char(sysdate,'yyyy'))
where checkCode=(select max(maxV)
from (select nvl(max(t1.checkCode), 0) as maxV
from TN_REGISTER_STANDARD t1
where t1.year = 2018
union
select nvl(max(t2.checkCode), 0) as maxV
from TN_VARIETY_CHECK t2
where t2.year = 2018
union
select nvl(max(t3.checkCode), 0) as maxV
from TN_APPLICATION t3
where t3.year = 2018));

转载于:https://www.cnblogs.com/lojun/p/9043366.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值