在表中计算值 [英] couting values in a table

查看:76
本文介绍了在表中计算值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有15张桌子.

我想在表的一行中找到值的出现.

例如:value=''N.A''

我想在表格的一行中找到'N.A'值的出现率.

即使表也有100列.

假设仅第50列包含"N.A",则计数值-1


我需要sql查询.

谁能帮助我.

I have 15 tables.

I want to find the ocurences of value in a row of a table.

ex: value=''N.A''

I want to find the ocurences of ''N.A'' value in one row of the table.

Even the table has 100 column also.

Suppose if ONLY 50th column consists ''N.A'' then count value - 1


I need sql query.

Can anyone help me.

推荐答案

您可以使用sys.tables视图获取表列表,并加入sys.columns以获得所有列的列表.

这可能是自由文本 [
You can get a list of tables using the sys.tables view, and join on sys.columns to get a list of all columns.

This would probably a good candidate for freetext[^]-query, but that''d require some more preparations.


这篇关于在表中计算值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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