如何顯示每2行到單列如何從表
表
Rowid batch maker checker date
1 101 john null 4feb
2 101 john raja 4feb
3 101 john null 5feb
4 101 john raja 6feb
5 101 john null 9feb
預期輸出
Batch maker checker
101 john raja -- 1st and 2nd row
101 john raja -- 3rd and 4th row
101 john null -- 5th row only
另外表將爲n nunber得到各2行到單列的列
如何查詢將每兩行合併爲單行
自外連接。 – jarlh
刪除某些行後,RowId最有可能會出現空白。 'Row_number()over(order by rowid)'會給你提供可靠的序列來與'%2'一起使用 – Serg
如果要合併的兩行具有不同的批量值,該怎麼辦? – jarlh