【发布时间】:2020-02-14 17:09:24
【问题描述】:
试图显示一个包含 3 列的表格,这些列是需要显示的价格。这些列由“price_type”区分,并且有 3 种不同的价格类型。
这可能是我缺少的一些明显的东西,但类似于:
Select price as 'current', price as '10min', price as '30min'
from table
where Price_Type(current) = 'current' AND Price_Type(10min) = '10min' AND
Price_Type(30min) = '30min'
Order by date desc
我不确定实际的语法是什么,但感谢任何帮助。
【问题讨论】:
-
欢迎来到 Stack Overflow。获取Tour 并阅读How To Ask。阅读此well structured question,然后阅读edit 您的问题,其中包含示例数据、表结构和所需结果,以帮助我们为您提供帮助。
标签: sql sql-server tsql group-by conditional-aggregation