SELECT length FROM film GROUP BY length ORDER BY title However, the below query is invalid because “title” is neither a part of grouping nor a result of aggregate function (like MAX or MIN) : SELECT length FROM film GROUP BY length ORDER BY 1 …or just by referring field in SELECT clause by number: SELECT length FROM film GROUP BY length ORDER BY length Totally fine, because we can derive all of these order by expressions from expressions in the select listĪctually, I would use the following explanation. ORDER BY clause, ordering by the mod(LENGTH, 10), LENGTH columns.DISTINCT clause, removing duplicate LENGTH values … all fine, because we don’t have the verboten extended sort key columns.MOD(LENGTH, 10) does not have to be put in the extended sort key columns, because it can be fully derived from the select list. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |