SQL/Regex Challenge/Puzzle: How to remove comments from SQL code (by using SQL query)?
问题 Requirements Single-lines comments (e.g. -- my comment) should be removed. Multi-line comments (e.g. /* my comment */) should be removed. The content of strings literals (e.g. 'this is a multi-line comment: /* my comment */') should be ignored. The content of identifiers (e.g. "-- column 1 --") should be ignored. literals and identifiers Literals and identifiers can span over multiple lines Single-line comments A single-line comment might be the last element of the code and might not end with