How do i compare 2 rows from the same table (SQL Server)

后端 未结 6 566
太阳男子
太阳男子 2020-12-02 16:15

I need to create a background job that processes a table looking for rows matching on a particular id with different statuses. It will store the row data in a string to comp

6条回答
  •  一整个雨季
    2020-12-02 16:30

    Some people find the following alternative syntax easier to see what is going on:

    select t1.value,t2.value
    from MyTable t1
        inner join MyTable t2 on
            t1.id = t2.id
    where t1.id = @id
    

提交回复
热议问题