我们在SQL Server -2005中有Vlookup()函数吗 [英] do we have Vlookup() function in Sql server -2005

查看:259
本文介绍了我们在SQL Server -2005中有Vlookup()函数吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

到目前为止,我一直在手动执行一些excel函数,例如vlookup(),现在我想通过查询sql-server 2005来自动执行此vlookup()函数.

我们在sqlserver-2005中是否具有vlookup()函数.

Hi All,

So far I was doing some excel functions manually like vlookup(), Now I would like to automate this vlookup() function through query sql-server 2005.

Do we have vlookup() function in sqlserver-2005.

推荐答案

SQL Server中没有直接的vlookup函数,但是说实话,vlookup是一种困难的方法无论如何都要做.

如果您使用此vlookup页面中的示例: http://www.techonthenet.com/excel/formulas/vlookup. php [ ^ ]

那么等效的SQL将是:
There is no direct vlookup function in SQL server, but to be honest, vlookup is a difficult way to do it anyway.

If you use the examples in this vlookup page:http://www.techonthenet.com/excel/formulas/vlookup.php[^]

Then the SQL equivalent would be:
SELECT Product FROM pvtTable WHERE OrderID=10251


SELECT UnitPrice FROM pvtTable WHERE OrderID=10251


SELECT Product FROM pvtTable WHERE OrderID=10248

最后一个不会返回任何记录.

The final one would return no records.


这篇关于我们在SQL Server -2005中有Vlookup()函数吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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