Re: [SQL] Dummy question

2007-03-22 Thread Ezequias R. da Rocha
Thank you very much Joe. Ezequias Joe escreveu: Hi Ezequias, On Thu, 2007-03-22 at 16:43 -0300, Ezequias R. da Rocha wrote: I must use a select * from some table but i must do a join and it must be in the were clause. I can't put select * from tabel1 as tb1, table2 as tb2 where tb2.id = 2

Re: [SQL] Dummy question

2007-03-22 Thread Joe
Hi Ezequias, On Thu, 2007-03-22 at 16:43 -0300, Ezequias R. da Rocha wrote: > I must use a select * from some table but i must do a join and it must > be in the were clause. > > I can't put select * from tabel1 as tb1, table2 as tb2 > where tb2.id = 2 > and tb1.fk_tb2ID = tb2.id Try select tb

[SQL] Dummy question

2007-03-22 Thread Ezequias R. da Rocha
Hi list, I must use a select * from some table but i must do a join and it must be in the were clause. I can't put select * from tabel1 as tb1, table2 as tb2 where tb2.id = 2 and tb1.fk_tb2ID = tb2.id I don't would like to use this select statement because the select brings us both columns (

Re: [SQL] Subqueryes

2007-03-22 Thread Ezequias R. da Rocha
Perfect quite nice. I am doing things that I could not believe I could do without the community. Thank you so much. -- Atenciosamente Ezequias Rodrigues da Rocha Richard Broersma Jr escreveu: update myTable set date = (current_date + (Select daysToAdd from base.Table1 where myFKey_id = Tab

Re: [SQL] growth of the database

2007-03-22 Thread Hubertus Freiherr von Fuerstenberg
Karthikeyan Sundaram wrote: Hi, Our database is growing fast. I want to create a cronjob that should tell me what is the current size of the database on each day. How can I find this from the database? Is there any pre-written scripts written by somebody to share? Hi, there is an

Re: [SQL] Subqueryes

2007-03-22 Thread Richard Broersma Jr
> > update myTable > set date = (current_date + (Select daysToAdd from base.Table1 where > myFKey_id = Table1Id) ) > where Expire_Date = now()::Date; Does this work: http://www.postgresql.org/docs/8.2/interactive/sql-update.html UPDATE myTable SET date = current_date + B.daysToAdd FROM Table1 B

Re: [SQL] Subqueryes

2007-03-22 Thread Alvaro Herrera
Ezequias R. da Rocha wrote: > Hi list, > > I must add some days (i.e:365) to my current_date and put it in my table > (an UPDATE). By now, it is simple but my "days to add" is in another table. > > How could I do this kind of update > > My sql is like this (but is not working): > > update myTa

[SQL] Subqueryes

2007-03-22 Thread Ezequias R. da Rocha
Hi list, I must add some days (i.e:365) to my current_date and put it in my table (an UPDATE). By now, it is simple but my "days to add" is in another table. How could I do this kind of update My sql is like this (but is not working): update myTable set date = (current_date + (Select daysToA

[SQL] unsubscribe

2007-03-22 Thread Susan Evans
unsubscribe -- Susan Evans Haywood County Schools NCWISE Coordinator 216 Charles Street Clyde, NC 28721 828-627-8314 (Phone) 828-627-8277 (Fax) 216 Charles Street Clyde, NC 28721 ---(end of broadcast)--- TIP 9: In versions below 8.0, the planne