如何编写select查询空值列不显示? [英] How to write select query null value column don't display?

查看:380
本文介绍了如何编写select查询空值列不显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





sql server选择查询:

================ =





我有memberTable有150列,在这150列70列强制列中

剩余列根据条件显示列,不应显示空值列。



示例:我有 50条记录我的memberTable。前70列是强制性的。在71到150中不是必填列,

如果表中有列只显示它的数据。剩余列不显示它。



col1,col2,col3 ... col150

col1到col70必须显示

col71到col150哪一列没有价值。不显示列



如何编写选择查询?



我尝试过:



select * from memberTable ;



它将显示所有列。但是在col71,col72,col73 ... col149,col150中,某些列具有空值.i不显示空值列或者空列。

Hi,

sql server select query:
=================


I have memberTable have 150 columns, in this 150 columns 70 columns mandatory columns
remaining columns based on condition display columns,null value columns should not display.

example: I have 50 records in my memberTable. first 70 columns mandatory.In 71 to 150 not mandatory columns,
if table have data that columns only show it.remaining columns don't show it.

col1,col2,col3...col150
col1 to col70 must display
col71 to col150 which column have no value.don't show that columns.

How to write select query?.

What I have tried:

select * from memberTable;

it will display all columns.but in col71,col72,col73 ... col149,col150 some columns have null value.i don't show null value columns or empty columns.

推荐答案

这不是一种实用的方法,因为每个记录都有可能具有不同的空列值组合。当您执行查询时,* ALL *行将具有相同的列(您在 SELECT 语句中指定)。
This isn't a practical approach because there's a possibility that every record will have a different combination of null column values. When you do a query, *ALL* rows will have the same columns (that you specify in the SELECT statement).


这篇关于如何编写select查询空值列不显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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