Paul DuBois wrote:
At 18:36 + 5/11/05, shaun thornburgh wrote:
Hi,
I keep getting thw following error when i include this line:
AND COUNT(SUBSTRING(PRACT_NUMBER, 1, 4)) > 1
mysql> SELECT PRACT_NUMBER,
-> COUNT(SUBSTRING(PRACT_NUMBER, 1, 4))
-> FROM CSV_Upload_Data
-> WHERE CSV_File = '
I would guess it's because you can't use an aggregate function in where, but
only in having. So use select group by PRACT_NUMBER having
COUNT(SUBSTRING(PRACT_NUMBER, 1, 4)) > 1.
The reason is that where is applied before the count is done, whereas having
after that. And you can't select by
At 18:36 + 5/11/05, shaun thornburgh wrote:
Hi,
I keep getting thw following error when i include this line:
AND COUNT(SUBSTRING(PRACT_NUMBER, 1, 4)) > 1
mysql> SELECT PRACT_NUMBER,
-> COUNT(SUBSTRING(PRACT_NUMBER, 1, 4))
-> FROM CSV_Upload_Data
-> WHERE CSV_File = 'ICS'
-> AND CHAR