10 / 10

Hello, SELECT

Selecting constants and a first query.

What you’ll learn

  • Selecting constants and basic SELECT shape.
  • Comment styles: -- (single line), /* ... */ (block).
-- Selecting constants
SELECT 1 AS One, N'Hello' AS Greeting;

/* Selecting from a system view */
SELECT TOP (3) name, object_id
FROM sys.objects
ORDER BY name;

Notes

  • Use N'...' for Unicode literals.
  • TOP (n) is non-deterministic without ORDER BY.