首页 > 数据库技术 > 详细

常见sql

时间:2020-04-08 17:58:35      阅读:51      评论:0      收藏:0      [点我收藏+]

1.case when else end的使用

/*验证添加字段是否成功,大于0成功,等于0失败*/
USE Lambor_Main
GO
SELECT (case COUNT(1) when 3 then 1 else 0 END) as number FROM sys.tables AS t
INNER JOIN sys.columns AS c ON t.object_id = c.object_id
LEFT JOIN sys.extended_properties AS ep
ON ep.major_id = c.object_id AND ep.minor_id = c.column_id
WHERE
t.name=‘RakeSetting‘
AND
(c.name=‘CreateMemberID‘ OR c.name=‘UpdateDateTime‘ OR c.name =‘CycleReverseAmountLimit‘)

常见sql

原文:https://www.cnblogs.com/yxcn/p/12660211.html

(1)
(1)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!