mysql - Getting Error Code: 8155 No column was specified for column 2 of 'pol' in SQL server -
select a.classname1 , a.classnumber , b.firstname + b.lastname , cl.status 'active' left bring together cl on a.id = cl.id left bring together (select a.id, count(b.teachcode) left bring together b on a.id = b.id grouping a.id) tt on tt.id = a.id
i have above code, homecoming error code 8155.i tried debug it, couldn't figure out went wrong.
why doing subquery, if count not used in output
you need bring together table b 1 time again subquery doesn't homecoming columns b
select a.classname1 , a.classnumber , b.firstname + b.lastname , cl.status 'active' left bring together cl on a.id = cl.id left bring together b on a.id =b.id -> needed left bring together (select a.id, count(b.teachcode) teachcode left bring together b on a.id = b.id grouping a.id) tt on tt.id = a.id
mysql sql sql-server
No comments:
Post a Comment