我有一张表格如下:
empId appid rolename contextname contextvalue fromdate todate
'1234' 1 admin manage view 2015-01-08 2015-31-08
'1234' 1 admin company US 2015-01-08 2015-31-08
'5678' 2 auditor action audit 2015-01-08 2015-15-08
'5678' 2 auditor report view 2015-01-08 2015-10-08
我给出了显示结果如下
empid appid rolename context1 context2 fromdate todate
'1234' 1 admin manage:View company:US 2015-01-08 2015-31-08
'5678' 2 auditor action:Audit NA 2015-01-08 2015-15-08
'5678' 2 auditor NA report:view 2015-01-08 2015-10-08
我已经尝试了stuff
和coalesce
功能,但我拥有的数据很大(10000条记录)。
请帮助..