none
Delete specific row RRS feed

  • Question

  • Hi,

    Could you please help me about the below question?

    I want to delete the row from temp-store table that has same store_no,id,date,product_no and the sum(qty)=0

    Create table temp-store(Stor_no int,

     Id int,

    Date varchar(10),

    product_no int,

    qty int)

    insert into temp_store(Store_no,id,date,product_no,qty) values

    (2,1332,’20180428’,100,7),

    (2,1330,’20180428’,100,0),

    (2,1381,’20180428’,100,7),

    (2,1369,’20180428’,100,-7),

    (2,1369,’20180428’,100,7),

    (2,1390,’20180429’,100,12),

    (2,1390,’20180429’,100,12),

    (3,1360,’20180515’,100,-6),

    (3,1360,’20180515’,100,6),

    (3,1360,’20180515’,100,6),

    (3,1360,’20180515’,100,12)

     

    I need to get the below result:

    Store_no,id,date,product_no,qty

    2,1332,’20180428’,100,7

    2,1330,’20180428’,100,0,

    2,1381,’20180428’,100,7

    2,1390,’20180429’,100,12

    2,1390,’20180429’,100,12

    3,1360,’20180515’,100,6

    3,1360,’20180515’,100,12



    Wednesday, November 13, 2019 3:35 AM

Answers

All replies