Re: [SQL] [NOVICE] Install two different versions of postgres which should run in parallel

2007-08-14 Thread Loredana Curugiu
On 8/13/07, Tom Lane <[EMAIL PROTECTED]> wrote: > > "Loredana Curugiu" <[EMAIL PROTECTED]> writes: > > For installing I am running the "configure" script as follows: > > > ./configure --prefix=/usr/local/pgsql-7.4.5 --with-java > --with-pg

Re: [SQL] Install two different versions of postgres which should run in parallel

2007-08-13 Thread Loredana Curugiu
I didn't succeed installing the two versions of postgres. For installing I am running the "configure" script as follows: ./configure --prefix=/usr/local/pgsql-7.4.5 --with-java --with-pgport=6947 Although I specify a different port than the default one, the postgres it is installed with the defa

[SQL] Install two different versions of postgres which should run in parallel

2007-08-10 Thread Loredana Curugiu
Hi all, I need to have two different vesions of postgres running in parallel on different ports. Does anyone knows how to install two different versions of postgres (7.4.5 and 8.2.4) on the same computer? I am using Linux operating system. Any information would greatly be appreciated. Loredana

Re: [SQL] dblink inside plpgsql function

2007-07-03 Thread Loredana Curugiu
I should read the documentation carrefully .. Yes, you're right, Richard. Many thanks to all. Best, Loredana

Re: [SQL] dblink inside plpgsql function

2007-07-03 Thread Loredana Curugiu
CREATE OR REPLACE FUNCTION getReminderServices( varchar ) RETURNS SETOF reminder_services AS' DECLARE r reminder_services%ROWTYPE; BEGIN PERFORM dblink_connect(''dbname=''||$1); FOR r IN SELECT * FROM dblink(''SELECT * FROM reminder_services'') AS columns( uid INT,

Re: [SQL] dblink inside plpgsql function

2007-07-03 Thread Loredana Curugiu
I created the following function CREATE OR REPLACE FUNCTION getReminderServices( varchar ) RETURNS SETOF reminder_services AS' DECLARE r reminder_services%ROWTYPE; BEGIN SELECT dblink_connect(''dbname=''||$1); FOR r IN SELECT * FROM dblink(''SELECT * FROM reminder_services'')

[SQL] dblink inside plpgsql function

2007-07-03 Thread Loredana Curugiu
Hi everybody, I created the following function: CREATE OR REPLACE FUNCTION GetReminderServices( varchar ) RETURNS SETOF reminder_services AS' BEGIN SELECT dblink_connect(''dbname=''||$1); SELECT * FROM dblink(''SELECT * FROM reminder_services'') AS reminder_services( uid INT,

[SQL] Replace usage of a table in query with its array values

2007-07-02 Thread Loredana Curugiu
Hi everybody, I have the following 3 tables: sent_messages uid | receiver| theme| date -+--+-+--- 1 | +40741775630 | CAND1 | 2007-06-12 14:06:57.843024+00 2 | +40741775630 | MAMA | 2007-06-12 14:07:

Re: [NOVICE] [SQL] Select last there dates

2007-06-21 Thread Loredana Curugiu
Thank you for documentation. Best regards, Loredana

Re: [SQL] Select last there dates

2007-06-21 Thread Loredana Curugiu
I think there might be a small typo though. The left-join is to: (select uid, phone_numer, datum from t2 order by 2 ) Probably want to order by "datum DESC" too, to ensure you get the latest dates for each telnum. yes, I also observed this, so I have add to my query. Thank you for your ex

Re: [SQL] Select last there dates

2007-06-21 Thread Loredana Curugiu
Richard, Andreas, thank you very much for your solutions. I took a look on both solutions, but I choosed Andreas's solution because is shorter :) So Andreas, would you please give some more explanations on your solution? I didn't work with functions and aggregate till now. I don't understand ho

[SQL] Select last there dates

2007-06-21 Thread Loredana Curugiu
Hello again, I have the following two tables: Table 1: uid | phone_number | -+--- 8 | +40741775621 | 8 | +40741775622 | 8 | +40741775623 | 9 | +40741775621 | 9 | +40741775622 | 9 | +40741775623 | 10 | +40741775621 | 10 | +40741775622 | 10 | +4074177562

Re: [SQL] JOIN

2007-06-06 Thread Loredana Curugiu
I forgot the attachement :) On 6/6/07, Loredana Curugiu <[EMAIL PROTECTED]> wrote: I found my problem. I attaches an .sql file with my tables, data and my new query. If you are interested you can take a look. Thanks to all. Regards, Loredana CREATE TABLE reminder_services (

Re: [SQL] JOIN

2007-06-06 Thread Loredana Curugiu
I found my problem. I attaches an .sql file with my tables, data and my new query. If you are interested you can take a look. Thanks to all. Regards, Loredana

Re: [SQL] JOIN

2007-06-06 Thread Loredana Curugiu
Oliveiros, I think it's time to give some more details about my task. I will start with the begining :) I have a "log" table which stores the dates when users send messages with a theme from their mobile phone. This table is named sent_messages and looks like this: receiver | theme

Re: [SQL] JOIN

2007-06-05 Thread Loredana Curugiu
On 6/5/07, Oliveiros Cristina <[EMAIL PROTECTED]> wrote: Hello again, Loredana. Additional information required :-) imagine the following situation 1| LIA | recv1 | date1 | (date1,date2) 2|LIA | recv1 |date 1 | (date2,date3) 3| LIA | recv1 | date1 | (date1,date3) Should this yield 6? Or 4

Re: [SQL] JOIN

2007-06-05 Thread Loredana Curugiu
Hmm...try to add the following clause to your INNER JOIN AND A.date = B.Date Like this : INNER JOIN view_sent_messages B ON A.theme=B.theme AND A.receiver=B.receiver AND A.date = b.Date AND B.date=ANY (A.dates) Doesn't work. I get the result

Re: [SQL] JOIN

2007-06-05 Thread Loredana Curugiu
On 6/5/07, Loredana Curugiu <[EMAIL PROTECTED]> wrote: On 6/5/07, Oliveiros Cristina <[EMAIL PROTECTED]> wrote: > > Hey, Loredana. Hi Oliveiros! Nice to "see" you again! Please advice me, > you need to sum for a certain pair (Theme, receiver) the number th

Re: [SQL] JOIN

2007-06-05 Thread Loredana Curugiu
On 6/5/07, Oliveiros Cristina <[EMAIL PROTECTED]> wrote: Hey, Loredana. Hi Oliveiros! Nice to "see" you again! Please advice me, you need to sum for a certain pair (Theme, receiver) the number that appears on count for every record whose date is in dates column, is this correct? Yap. Bu

Re: [SQL] JOIN

2007-06-05 Thread Loredana Curugiu
You don't actually say what's wrong. What are you expecting as output? I should obtain the following result: sum | theme | receiver | dates +--+--+ 8 | CRIS | +4074

[SQL] JOIN

2007-06-05 Thread Loredana Curugiu
Hi everybody, I have the following table: count | theme | receiver| date | dates | ---+---+--++

Re: [SQL] JOIN

2007-06-05 Thread Loredana Curugiu
So I have the following query:>> >>SELECT SUM(A.count), >> A.theme, >> A.receiver, >> A.dates >> FROM my_table A >> INNER JOIN my_table B >> ON A.theme=B.theme >> AND A.receiver=B.receive

Re: [SQL] JOIN

2007-06-05 Thread Loredana Curugiu
Any help, please? On 6/5/07, Loredana Curugiu <[EMAIL PROTECTED]> wrote: Hi everybody, I have the following table: count | theme | receiver| date |

[SQL] Count rows by day interval

2007-05-10 Thread Loredana Curugiu
Dear all, I have the following 3 tables: TABLE 1: themes uid | theme -+ 1 | HOME 2 | BILL 3 | ERROR 4 | ACTION 5 | ANA 6 | LIA 7 | MIA TABLE 2: reminder_services uid | theme_uid | activity_min_days | activity_max_months -++