如何使用CASE语句删除一行(一个或多个) [英] How to Delete a Row (one or More) Using CASE Statement

查看:148
本文介绍了如何使用CASE语句删除一行(一个或多个)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用CASE语句删除表中的某些行

How to Delete some Rows in a Table Using CASE Statement

推荐答案

在最简单的场景中,您将以两种方式使用case语句:



1 - 修改WHERE子句的内容

2 - 从组件数据创建一个查询,如案例所暗示为字符串然后执行EXEC查询。



如果您在如何使用案例陈述方面需要帮助,请考虑 https://msdn.microsoft.com/en-us/library/ms181765.aspx [ ^ ]
In the simplest scenarios, you would use the case statement in either of two ways:

1 - modify the contents of the WHERE clauses
2 - create a query from component data as implied by the case as a string and then EXEC the query.

If you need help in how to use case statement, consider https://msdn.microsoft.com/en-us/library/ms181765.aspx[^]


这篇关于如何使用CASE语句删除一行(一个或多个)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆