The SQL statement is not really valid.
COUNT(*) is an aggregate function, meaning, it will aggregate data from all records (in the group) and return one record for it. Without a GROUP BY clause, there is only one group: the entire table. This means that the query will return exactly one record, and that will be the count of records in the table. Because of that, the ORDER BY clause makes no sense. Both because one record does not need an ordering, and because the column mentioned in the ORDER BY clause does not appear in the column list. (Columns not specifically mentioned in an aggregate query's GROUP BY clause are not valid to be referred to outside an aggregate function.)
To make that statement valid (and sensical) it would be written: SELECT Id, COUNT(*) FROM Items GROUP BY Id ORDER BY Id; (ASC is the default and nearly always left out.)
In reply to Re: Perl/Tk freezes while waiting the data to arrive on mysql server
by chacham
in thread Perl/Tk freezes while waiting the data to arrive on mysql server
by Muskovitz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |