Home > database >  SQL query problem didn't write detailed rewritten now
SQL query problem didn't write detailed rewritten now

Time:09-20

BZ RN ZT KHBH
KeJingHua review 1865980383920181031233145 retail sales when single YD - 2018-000594 to automatically generate 1 1 1007
KeJingHua review 1865980383920181031233145 retail sales when single YD - 2018-000595 automatic generation of 2 1 1007
KeJingHua review 1865980383920181029143433 retail sales when single YD - 2018-000680 to automatically generate 1 1 1026
KeJingHua review 1865980383920181020155134 retail sales when single YD - 2018-000311 to automatically generate 1 1 1047
KeJingHua review 20181017093941 retail sales when single YD - 2018-000206 to automatically generate 1 1 1058
KeJingHua review 20181018141508 retail sales when single YD - 2018-000230 to automatically generate 1 1 1060
KeJingHua review 20181018141508 retail sales when single YD - 2018-000229 automatic generation of 2 1 1060

The SELECT bz, ROW_NUMBER () OVER (PARTITION BY KHBH ORDER BY DDBH) rn, zt, KHBH FROM XSDD where zt!=1




Row_number () over () is there a way to put the BZ inside the first and second guild regulations together, is need in this way,
KeJingHua review 1865980383920181031233145 retail sales when single YD - 2018-000594 to automatically generate 1 1 1007
KeJingHua review 1865980383920181031233145 retail sales when single YD - 2018-000595 to automatically generate 1 1 1007

CodePudding user response:

The SELECT bz, dense_rank () OVER (PARTITION BY KHBH ORDER BY DDBH) rn, zt, KHBH FROM XSDD where zt!=1
  • Related