There is a problem I have experienced in mssql. ( but I don't have this problem in mysql. ) They know two different engines. but I could not find a solution. Do you think I can fix this error?
My query is
SELECT COUNT(*) as stok_adet, s.*, m.*, d.* FROM stok as s CROSS JOIN mermer_cins as m JOIN stok_durum as d ON s.stok_durum_id = d.stok_durum_id WHERE m.mermer_cins_id='5' AND s.blok_no='M6320' GROUP BY s.bundle_no, s.boy, s.yukseklik, s.hatali ORDER BY s.blok_no ASC, s.bundle_no ASC, s.stok_tarih DESC"
And the error reason I get in mssql
Column 'stok.stok_id' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
These are the design of my tables in mssql.
mermer_cins table=> https://pasteboard.co/IofwCGc.jpg
stok table => https://pasteboard.co/Iofx1QV.jpg
stok_durum table => https://pasteboard.co/IofxfJg.jpg
Here is the screenshot link of my running query in mysql. => https://pasteboard.co/Iof1DVa.png