0 votes 0 votes what will be the output of the query ? SELECT A, Avg(B) FROM R GROUP BY A: Table R A B C a1 b1 80 NULL b2 90 a3 b5 40 NULL b2 30 a1 b1 90 a3 b6 NULL hitendra singh asked Nov 14, 2018 hitendra singh 491 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
2 votes 2 votes A B(avg) a1 b1 a3 (b5+b6)/2 null b2 null b2 in SQL every null treated as different Gurdeep Saini answered Nov 14, 2018 • edited Jan 18, 2019 by Gurdeep Saini Gurdeep Saini comment Share Follow See 1 comment See all 1 1 comment reply hitendra singh commented Nov 14, 2018 reply Follow Share i also think the same.... 1 votes 1 votes Please log in or register to add a comment.
0 votes 0 votes Avg(B) A(group by A) (b1+b1)/2 a1 (b5+b6)/2 a3 b2 Null b2 Null Null is non zero and two null value may not same Null is a sequence of ASCII character assigned by DBMS in such way two nulls may not same --->(Code Rule) Rackson answered Nov 14, 2018 • edited Nov 14, 2018 by Rackson Rackson comment Share Follow See all 5 Comments See all 5 5 Comments reply Show 2 previous comments hitendra singh commented Nov 14, 2018 reply Follow Share I have read somewhere that every null is treated as different.. 0 votes 0 votes Gurdeep Saini commented Nov 14, 2018 reply Follow Share yes every null will be treated as different 0 votes 0 votes hitendra singh commented Nov 14, 2018 reply Follow Share then I think there must be 4 rows in the output Isn't it? 0 votes 0 votes Please log in or register to add a comment.