| From: | "Devinder K Rajput" <Devinder(dot)Rajput(at)ipaper(dot)com> | 
|---|---|
| To: | ycnyon(at)pd(dot)jaring(dot)my | 
| Cc: | pgsql-novice(at)postgresql(dot)org, pgsql-novice-owner(at)postgresql(dot)org | 
| Subject: | Re: SQL statement to copy a result set to create | 
| Date: | 2002-11-12 19:33:31 | 
| Message-ID: | OFA298AD33.1F8F34F6-ON86256C6F.006B32FE@ipaper.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-novice | 
I think a view would the better route.  This is because if you write a
query, it will have to be rerun every time before you get the up-to-date
results.  However, with the view, the up-to-date results will always be
available.
regards,
Devinder
                                                                                                                            
                    "YC Nyon"                                                                                               
                    <ycnyon(at)pd(dot)jaring(dot)my>         To:     pgsql-novice(at)postgresql(dot)org                                       
                    Sent by:                      cc:                                                                       
                    pgsql-novice-owner(at)post       Subject:     Re: [NOVICE] SQL statement to copy a result set to create    
                    gresql.org                     another table.                                                           
                                                                                                                            
                                                                                                                            
                    11/11/2002 08:14 PM                                                                                     
                                                                                                                            
                                                                                                                            
I want to create a new table based on an earlier result set from a SQL
query.
For example;
Query 1:
Select * from test where id >20
This will give me a result that 10 records found.
I would like to create a new table and insert these 10 records.
Also, I looking into views. would that be a better choice. The application
let users store their data via PHP.
Thanks
Nyon
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Giovanni Alexander Briceño Riveros | 2002-11-12 20:01:14 | I need help | 
| Previous Message | Rory Campbell-Lange | 2002-11-12 17:51:33 | Re: return column id from insert |