如何根据逻辑条件在sql l中执行查询 [英] How to execute a query in a sql l based on logical conditions
问题描述
假设,每天在dbo.anytab中加载信息
Suppose, every day in dbo.anytab loaded information
让我们考虑一行
如何创建条件
如果此查询中的所有列都有数据
if all columns from this query have data
其中Cf0 ...和custo,er_na,e = ...,squ = 11等等
where Cf0... and custo,er_na,e=... , squ=11 and so on
我第一次检查IE, ; 所有列都有任何含义吗?
I.E the first i do check, Do all columns have any meaning?
如果所有列都有数据,那么查询应该有效(使用dbo获取数据.tab1
否则如果cfo列 没有data.then查询工作(获取数据)与tab2
else if cfo column doesn't have data.then query works(takes data) with tab2
否则,如果 customer_name列没有数据,那么查询必须工作使用tab3
else if customer_name column doesn't have data, so query must work with tab3
推荐答案
抱歉什么是tab1,tab2,tab3等?他们是不同的桌子吗?
sorry what are tab1,tab2,tab3 etc? are they different tables?
你上面只显示了一张表,其他人可能是列?
You've showed only single table above so may be others are columns??
您是否要求根据数据是否存在少数列来有选择地过滤行?
Are you asking for selectively filtering rows based on whether data exists for few columns or not?
这篇关于如何根据逻辑条件在sql l中执行查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!