Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. CREATE TABLE "teste" (
  2. "id" int8 DEFAULT nextval('teste_id_seq'::regclass) NOT NULL,
  3. "start_date" timestamp(6),
  4. "end_date" timestamp(6),
  5. CONSTRAINT "teste_pkey" PRIMARY KEY ("id")
  6. )
  7.  
  8. INSERT INTO "teste" VALUES ('2019-3-17 17:38:23', '2019-3-18 17:40:00');
  9. INSERT INTO "teste" VALUES ('2019-3-17 17:20:00', '2019-3-17 18:39:07');
  10.  
  11.  
  12. select end_date-start_date from teste;
  13. select sum(end_date-start_date) from teste;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement