Originally Posted by
simon1066
Sure, will do.
Edit:
Can I ask what you mean by 'database mode', is it innodb/myisam?
Not necessarily those, but in some modes, attempting to sort a data set on a field that is not being returned in the SELECT statement can cause a sql "error"... If the database mode (sql_mode) includes: ONLY_FULL_GROUP_BY then grouping by a field that is not in the select list of that query will cause an error (e.g. ORDER BY clause is not in SELECT list ......) such as if running this query:
Code:
SELECT products_price FROM products ORDER BY products_id;
Would either, use a sub-query to return both the products_id and products price sorted on the desired order to then select from that list just the products_price or just use a single query that returns both fields and only use the field(s) necessary...
Bookmarks