Skip site navigation (1) Skip section navigation (2)

Method Question

From: "Ben Burkhart" <poutine(at)mudportal(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Method Question
Date: 2004-01-28 05:08:07
Message-ID: 60182.65.31.25.1.1075266487.squirrel@webmail.mudportal.com (view raw or flat)
Thread:
Lists: pgsql-novice
I'm making a layout for a timecard, if a user could clock in/out just once
per day, it wouldn't be a problem, but I need to assume no limits, I
currently have it setup


CREATE TABLE timecard ('id' SERIAL,'employee' varchar(100),'time'
timestamp, inorout varchar(5));

 id | emp  |        time         | outorin
----+------+---------------------+---------
  4 | 9826 | 2004-01-27 06:08:52 | i
  5 | 9826 | 2004-01-27 06:19:54 | o
  6 | 9826 | 2004-01-27 06:20:05 | i
  7 | 9826 | 2004-01-27 08:15:13 | o


Using that as example of the data, how could I tell how many hours have
been in between each i and o? This question stumpeth me. Please help.


Responses

pgsql-novice by date

Next:From: Aarni RuuhimäkiDate: 2004-01-28 06:02:03
Subject: Re: Install or Bust - pgsql on Red Hat 9
Previous:From: Phil SerettiDate: 2004-01-28 05:06:54
Subject: Install or Bust - pgsql on Red Hat 9

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group