'Is it possible to write a comment after a ';' in an SQL query?

In this code:

SELECT * FROM Customers
ORDER BY CustomerName ASC; -- some comment

If a comment is not part of the query/code, why can't I write it after the ';' char? (Just tried it in w3schools example DB)

How can I otherwise create comments at the end of the query, if at all?

Thanks in advance



Solution 1:[1]

If you have a complex SQL-Script, the comments make it better readable so it make sense. If you need the query only once the comment is useless.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 KleeSchulz