在sql数据库中将商品表中商品号前两位编号为10的商品的单价修改为出厂单价的0.1。怎么做

在sql数据库中将商品表中商品号前两位编号为10的商品的单价修改为出厂单价的0.1。怎么做,第1张

表名:tb_goods

单价:price

编号:no

update tb_goods set price=price*0.1 where no like '10%'

alter table CS01 add constraint CK_A800 check (LEN(A8)=8)

alter table CS01 add constraint CK_A8001 check (A8 like '00%')

alter table CS01 add constraint CK_A8003 check (ascii(substring(A8,3,1))>=48 and ascii(substring(A8,3,1))<=57)

alter table CS01 add constraint CK_A8004 check (ascii(substring(A8,4,1))>=48 and ascii(substring(A8,4,1))<=57)

--下划线是通配符

alter table CS01 add constraint CK_A8005 check (ascii(substring(A8,5,1))>=ascii('_'))

--只允许输入大写字母

alter table CS01 add constraint CK_A8006 check (ascii(substring(A8,6,1))>=65 and ascii(substring(A8,6,1))<=90)

alter table CS01 add constraint CK_A8007 check (ascii(substring(A8,7,1))>=65 and ascii(substring(A8,7,1))<=90)

alter table CS01 add constraint CK_A8008 check (ascii(substring(A8,8,1))>=65 and ascii(substring(A8,8,1))<=90)我也是菜鸟一个 这么写看着确实有点傻


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/sjk/9633318.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-30
下一篇2023-04-30

发表评论

登录后才能评论

评论列表(0条)

    保存