i think there should be a _ between continuity code as it's an syntax error X_X WHERE code=information should be WHERE code='information' um.. that should be it XD
It seems it has been changed again... however the quotes around information weren't added and the condition PERSONAL NAME Asakura Ryouko was added.SELECT continuity_code
FROM databank
WHERE code='information'
ORDER BY aggressive_combat_data
HAVING END_MODE
SELECT continuity, code
FROM databank
WHERE code=information
ORDER BY aggressive_combat_data
HAVING end_mode
PERSONAL NAME Asakura Ryouko
In any case, in SQL syntax there is no such thing as a PERSONAL NAME modifier (and in any case, Asakura Ryouko would have to be enclosed between quotes). The usage of HAVING is incorrect as well, since the HAVING must be used in conjuction with a GROUP BY statement (which is not present) and it must be followed by a condition (normally an arithmetic one)...however it is such a trivial issue that it might not be worth correcting, but what do other people think about it? Was it like that in the original version? If that's the case, it might not be worth correcting -Proto 1:14, 1 May 2006 (Central)
Odd, I'm looking at the original text, and it seems to be more like this:
"Target name Asakura Ryoko, hostility confirmed[...]"SELECT serial_code
FROM database
WHERE code='data'
ORDER BY aggressive_combat_data
HAVING terminate_mode
I'm going to make the change, but if it seems wrong, feel free to change it back.
--Kumarei 12:27, 8 May 2006 (EST)
I'd just like to comment that HAVING is used incorrectly, however not as was previously stated. HAVING does not need to be used in conjunction with a GROUP BY statement. HAVING is only used when doing boolean compairisons on an aggregate function returned by the select. In most cases this means that the GROUP BY statement is there because if you select anything aside from the aggregate function, the GROUP BY is required to make it work. If you were only selecting the aggregate function however, then there would be no GROUP BY, and the HAVING caluse would be valid (Albeit stupid since you're only getting 1 number returned by the select, and running a HAVING boolean check on 1 number would be useless).
Anyways, the HAVING clause is incorrect because the only time you use HAVING is when running a boolean compairison on an aggregate function. It's a WHERE statement for aggregate functions.
Example
That's an appropriate use of HAVING because it's running a compairison on the aggregate function sum(y). Only in situations such as this one is HAVING a valid statement. In any other situations, the comparision would be contained in the WHERE portion of the statement.SELECT X, sum(y) as total
FROM table
WHERE x = 2
GROUP BY X
HAVING total > 5
-Seigfreid