Variables in SQL

From ZhoubaWiki
Revision as of 11:46, 15 October 2025 by Garak (talk | contribs) (Created page with "<pre> WITH vars as ( SELECT 'my-very-long-long-name' as foo, 112098237449803127134987 as num, '{"hello":"there"}'::json as js ) SELECT vars.foo, vars.js->'...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
WITH vars as (
  SELECT 'my-very-long-long-name' as foo,
         112098237449803127134987 as num,
         '{"hello":"there"}'::json as js
)
SELECT vars.foo, vars.js->'hello', num / 2
FROM vars;