comments.sql 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. --
  2. -- COMMENTS
  3. --
  4. SELECT 'trailing' AS first; -- trailing single line
  5. SELECT /* embedded single line */ 'embedded' AS second;
  6. SELECT /* both embedded and trailing single line */ 'both' AS third; -- trailing single line
  7. SELECT 'before multi-line' AS fourth;
  8. /* This is an example of SQL which should not execute:
  9. * select 'multi-line';
  10. */
  11. SELECT 'after multi-line' AS fifth;
  12. --
  13. -- Nested comments
  14. --
  15. /*
  16. SELECT 'trailing' as x1; -- inside block comment
  17. */
  18. /* This block comment surrounds a query which itself has a block comment...
  19. SELECT /* embedded single line */ 'embedded' AS x2;
  20. */
  21. SELECT -- continued after the following block comments...
  22. /* Deeply nested comment.
  23. This includes a single apostrophe to make sure we aren't decoding this part as a string.
  24. SELECT 'deep nest' AS n1;
  25. /* Second level of nesting...
  26. SELECT 'deeper nest' as n2;
  27. /* Third level of nesting...
  28. SELECT 'deepest nest' as n3;
  29. */
  30. Hoo boy. Still two deep...
  31. */
  32. Now just one deep...
  33. */
  34. 'deeply nested example' AS sixth;
  35. /* and this is the end of the file */