2021年1月6日星期三

How adding some values in join works?

I have Following query

select a.id as 'as',b.id as 'b',a.student,b.student from seat a left join seat b on a.id+ case when a.id%2=0 then -1 else 1 end = b.id

which is giving me following output

enter image description here

can someone explain me how join condition is working? why value of b.id is changing ?

https://stackoverflow.com/questions/65606020/how-adding-some-values-in-join-works January 07, 2021 at 10:50AM

没有评论:

发表评论