User Tools

Site Tools


postgres_sql_cheat_sheet

Postgres SQL Cheat Sheet

For MS SQL, see SQL Cheat Sheet

Basic Query

Put column names in double quotes.

SELECT
      "ApiResources"."Name" AS ApiResourceName
    , "ApiResources"."DisplayName" AS ApiResourceDisplayName
    , "ApiScopes"."Name" AS ScopeName
    , "ApiScopes"."DisplayName" AS ScopeDisplayName
    , "ApiResources".*
FROM
    config."ApiResources"
LEFT JOIN
    config."ApiScopes"
    ON "ApiResources"."Id" = "ApiScopes"."ApiResourceId"
WHERE 1 = 1
    AND "ApiScopes"."Name" = 'xero_identity_test'

TOP n

Use LIMIT n instead.

SELECT *
FROM   IDENTITY.users
LIMIT  10
postgres_sql_cheat_sheet.txt · Last modified: 2025/01/14 02:52 by stephen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki