sql server - Combine row after used group by in SQL -
i have created query
select count(currentslideid) attempts, currentslideid, userlessonprogressid, ishint useranswers (userid = 169494) , userlessonprogressid=218629 group userlessonprogressid, currentslideid, ishint order userlessonprogressid, currentslideid
and output of above query looks like
now want combine last 2 row in 1 row
attempts=2 currentslideid=19328 userlessonprogressid=218629 , ishint=1
keep query, max(ishint)
, remove column group by
:
select count(*) attempts, currentslideid, userlessonprogressid, max(ishint) useranswers userid = 169494 , userlessonprogressid = 218629 group currentslideid, userlessonprogressid order currentslideid, userlessonprogressid
Comments
Post a Comment