Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE "table" (
- "id" int4 NOT NULL,
- "edit_date" date,
- "app_date" date,
- "app_id" int4,
- "status" varchar(255)
- )
- SELECT
- app_id, status
- FROM
- table
- WHERE
- app_id = 1
- ORDER BY
- app_date DESC,
- edit_date DESC
- LIMIT 1
- SELECT
- app_id, status
- FROM
- table
- WHERE
- app_id in (...)
- ORDER BY
- app_date DESC,
- edit_date DESC
- ...
Add Comment
Please, Sign In to add comment