如何根据其他列值选择列值 [英] How to select a column value based on other columns values
本文介绍了如何根据其他列值选择列值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我有下表
制造商型号
无孔口
无1.5IPO
无1.0PPO
Altec A2
Camco C2
我需要我的结果如下:
当我选择None作为制造商时,只有 orifice
, 1.5IPO
和<$ c应显示$ c> 1.0PPO 。
我如何实现这一目标?
解决方案
SQL:
SELECT 制造商,型号
FROM TableName
WHERE 制造商= ' 无'
Linq
var qry = 来自工具 工具
其中 tool.Manufacturer == 无
选择工具;
Hi
I have the following table
Manufacturer Model
None orifice
None 1.5" IPO
None 1.0" PPO
Altec A2
Camco C2
I need my result to be in following form:
when i select None as a manufacturer, only orifice
, 1.5" IPO
and 1.0" PPO
should be displayed.
How can i achieve this??
解决方案
SQL:
SELECT Manufacturer, Model FROM TableName WHERE Manufacturer = 'None'
Linq
var qry = from tool in tools where tool.Manufacturer == "None" select tool;
这篇关于如何根据其他列值选择列值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文