1
MS SQL Server中,表1COALESCE用于连接
comment_no comment
1 excellent
2 ok
3 acceptable
表2
name service_comment quality_comment quantity_comment
shop1 0 0 1
shop2 0 2 0
shop3 1 0 0
结果表将
name service_comment quality_comment quantity_comment comment
shop1 0 0 1 Excellent
shop2 0 2 0 good
shop3 1 0 0 excellent
我怎么合并两个表一起?因为每个商店都需要注释详细信息。感谢
如果有什么的三个值1,2,3?如果是3,2,1呢? – GurV
对我来说,你为这个查询而苦苦挣扎的原因是因为你的表格设计有缺陷。你的table2应该有一个列表明它是哪种类型的评论。 –