Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个查询,每个ID. 我希望能够基于ID.
ID
每行只会有两行ID。如下例所示,一行将只包含ColumnA,而另一行将包含ColumnB.
ColumnA
ColumnB
因此,这是目前数据外观的简化版本:
这就是我想要的样子,虽然我不完全确定如何去做:
您可以通过聚合来做到这一点:
select ID, max(ColumnA) ColumnA, max(ColumnB) ColumnB from TableName group by ID