具有已定义列的已定义单元格的表名称为空 [英] getting table name with defined cell of defined column is blank

查看:90
本文介绍了具有已定义列的已定义单元格的表名称为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,
我无法在sql中获得带有已定义列的已定义单元格的表名.
谁能帮我.
谢谢,
Akkywadhwa

Hi Friends,
I am unable in getting table name with defined cell of defined column is blank in sql.
Can anyone help me.
Thanks,
Akkywadhwa

推荐答案

您的意思是说,当您从表中查询数据时,如果该列中的值为空,则不会得到结果吗?如果真是这样,那么您必须在查询中使用IS NULL条件.例如
Do you mean that when you query data from a table you don''t get results if the value in the column is empty? If that''s the case then you must use IS NULL condition in your query. For example
SELECT * FROM TableName WHERE ColumName IS NULL;


要通过列名获取表名,请使用以下命令:
To get table name by column name, use this:
SELECT t.name As TableName, c.Column_Name
FROM sys.tables t INNER JOIN information_schema.columns c ON c.Table_Name = t.Name
WHERE [Column_Name] = @ColName


这篇关于具有已定义列的已定义单元格的表名称为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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