Help needed creating a view

From: Sebastian Tennant <sebyte(at)smolny(dot)plus(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Help needed creating a view
Date: 2012-01-26 11:54:44
Message-ID: zkdak7az.fsf@chimera.gnukahvesi.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi list,

Given an 'applications' table for a static set of courses::

user_id (integer)
course_name (text)
completed (boolean)

how best should I go about creating an 'alumni' view with columns:

user_id (integer)
maths (boolean)
english (boolean)
. .
. .
. .

where each of the columns (apart from user_id) is a boolean value representing
whether or not user_id completed each course?

Sebastian
--
Emacs' AlsaPlayer - Music Without Jolts
Lightweight, full-featured and mindful of your idyllic happiness.
http://home.gna.org/eap

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Angelico 2012-01-26 11:56:09 Re: Best way to create unique primary keys across schemas?
Previous Message Leguevaques Alex 2012-01-26 09:22:16 Composite Type : pros and cons