pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexandre Gonçalves Jacarandá <clark_vr@yahoo.com.br>
To: pgsql <pgsql-sql@postgresql.org>
Subject: select and as doubt
Date: Sun, 15 Jan 2006 01:55:33 -0200
Message-ID: <43C9C7B5.5070707@yahoo.com.br> (raw)

Hello folks!!!
I've a question that could be very strange:
It's possible to make an SELECT inside an AS clause ?

ex.:
select student_id, subject_name_id, grade as (select subject_name from
subject_names) from grades;

The wy is that i've a table with subject names and another with name_id
and grades like:
Table subject_names ( id, subject_name);
Table students ( id, name);
Table grades ( student_id, subject_name_id, grade)

My goal is display an report that have this layout:

Name	| Math | Bio |  English
Joe Doe | 10   | 8   |  6
Mary	| 8    | 6   |  5

I try to make this with crosstab, but I need that columns with suject
grades are displayed automaticlly

Thanks.

-- 
__________________________
Alguns caminham pelo arco,
eu caminho pela reta.

Alexandre Gonçalves Jacarandá
Assessor de Tecnologia de Informação
Tel.: 0 ** 21 8131-2313

	

	
		
_______________________________________________________ 
Yahoo! doce lar. Faça do Yahoo! sua homepage. 
http://br.yahoo.com/homepageset.html 




view thread (4+ messages)  latest in thread

Message-ID: <43C9C7B5.5070707@yahoo.com.br>
Permalink:  ../43C9C7B5.5070707@yahoo.com.br/
Also on:    postgresql.org/message-id/43C9C7B5.5070707@yahoo.com.br

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: clark_vr@yahoo.com.br
  Subject: Re: select and as doubt
  In-Reply-To: <43C9C7B5.5070707@yahoo.com.br>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox