SQL Puzzle

From: "Ben-Nes Michael" <miki(at)canaan(dot)co(dot)il>
To: <pgsql-general(at)postgresql(dot)org>
Subject: SQL Puzzle
Date: 2002-06-30 14:32:46
Message-ID: 000d01c22043$00b2a300$aa0f5ac2@canaan.co.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi All

I have a table where all worker logon and out every day:

table columns: record_id, worker, log_time, status, description

If a worker was absent there will be no record for the current day.

Now, I want to query this table to get a list of all days in month and in an
aditional field i would like to put worked/abscent ( depends if he was or
was not )

Is it possible in SQL ?

I thought about fuction with 'for' from 1 to 30 then subselect to check if
worker worked on a current day but its a complicated solution.

Does any body have idea for easier method ?

I can do it easily in php but i want to do as maximum as I can on the db
itself.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2002-06-30 14:54:26 Re: Shared Memory Sizing
Previous Message Raphael Bossek 2002-06-30 10:51:40 PostgreSQL Lite for low-end/embedded systems (16MB of total memory)