In MySQL funktioniert dieser Code einwandfrei:
select f, blegg.* from blegg limit 1;
+------+------+------+------+
| f | f | g | h |
+------+------+------+------+
| 17 | 17 | 2 | 17 |
+------+------+------+------+
1 row in set (0.00 sec)
Warum führt dieser Code dann zu einem Syntaxfehler?
select f, * from blegg limit 1;
-- * is unqualified
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '*
from blegg limit 1' at line 1
Ich habe im Handbuch nachgeschaut, aber nichts wirklich gefunden. Warum scheitert select , * ...
während `select , .* ... und `select * ...
select *, ...`
und erfolgreich sind?```
0 Stimmen
Ich kann nicht erklären, warum. Aber ich weiß, dass Oracle das Gleiche tut.