[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] sql select fra to tabeller



Du kan kigge på UNION, og skrive noget a la:

SELECT dato FROM tabel_a WHERE dato > date('now') UNION
SELECT dato FROM tabel_b WHERE dato > date('now');

Dit andet spørgsmål:

SELECT fornavn || efternavn as navn FROM tabel;

Jeg har ikke prøvet at køre det, bare set i den dokumentation jeg kunne
finde på nettet, så held og lykke.

Du kan jo evt kigge på denne url:

http://www.postgresql.org/docs/8.1/static/functions-string.html

Mvh

Lars


Magnus wrote:
> Hej,
> 
> Hvordan er det lige man laver et (postgresql) select fra to tabeller og
> får det samlet i en?
> 
> Jeg vil gerne have:
> SELECT dato FROM tabel_a WHERE dato > date('now'); samlet med
> SELECT dato FROM tabel_b WHERE dato > date('now');
> 
> Så jeg kan have et "ORDER BY dato LIMIT 3" på den samlede tabel.
> 
> 
> Et andet spørgsmål, i samme stil. Hvordan får man:
> SELECT fornavn, efternavn FROM tabel;
> 
> samlet til bare "navn" og ikke to kolonner?
> 
> 


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2006-06-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *