Re: [SQL] mail alert

2009-08-12 Thread Jan Verheyden
Hi, Is it possible to use pgsql for creating a mailer script?? Can you help me as well with my first question? (below) Thanks a lot! Jan -Original Message- From: Rob Sargent [mailto:robjsarg...@gmail.com] Sent: Wednesday, August 12, 2009 4:01 PM To: Jan Verheyden Cc: 'Denis BUCHER'; 'p

Re: [SQL] mail alert

2009-08-12 Thread Jan Verheyden
Hi, I got a bit stuck... I was looking for a solution for option a) Maybe I'll first explain the situation a bit more: I have one database for patient registration Another one for image storage And a third one for book keeping A patient should be registered first before the images are stored, s

Re: [SQL] Updating a specific number of rows in pl/pgsql

2009-08-12 Thread Xharon
ctid is the physical location of the row version, so it's not static.. check http://www.postgresql.org/docs/8.2/static/ddl-system-columns.html -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] mail alert

2009-08-12 Thread Jan Verheyden
It's on Windows From: ramasubramanian [mailto:ramasubramania...@renaissance-it.com] Sent: Wednesday, August 12, 2009 6:01 AM To: Jan Verheyden; pgsql-sql@postgresql.org Subject: Re: [SQL] mail alert Hi, Can you just tell me whether your database is place on which server(linux/or windows or..

Re: [SQL] Month/year between two dates

2009-08-12 Thread Jorge Godoy
I think he wanted something like: test=# create table month_test(id serial primary key, start_date date not null, end_date date not null); CREATE TABLE test=# insert into month_test (start_date, end_date) values ('2009-01-01'::date, '2009-08-31'::date); INSERT 0 1 test=# insert into month_test (st

Re: [SQL] mysql code questions

2009-08-12 Thread Greg Stark
On Wed, Aug 12, 2009 at 7:52 PM, Thomas Kellerer wrote: > Ray Stell wrote on 12.08.2009 20:19: > I would probably do it this way: > > SELECT tt. * > FROM testtable tt > WHERE create_date = (SELECT MAX(create_date) >                     FROM testtable tt2 >                     WHERE tt.id = tt2.id);

Re: [SQL] mysql code questions

2009-08-12 Thread Thomas Kellerer
Ray Stell wrote on 12.08.2009 20:19: http://www.brentozar.com/archive/2009/04/getting-the-most-recent-record/ How this works? What is ttNewer? What is a clustered primary key in mysql? That article talks about SQL Server not MySQL. select tt.* FROM TestTable tt LEFT OUTER JOIN TestTable

[SQL] mysql code questions

2009-08-12 Thread Ray Stell
http://www.brentozar.com/archive/2009/04/getting-the-most-recent-record/ How this works? What is ttNewer? What is a clustered primary key in mysql? This is as good as I can do to get this into pg: create table TestTable ( id int not null, create_date date not null, info1 VARCHAR(50) NOT NULL

Re: [SQL] mail alert

2009-08-12 Thread Rob Sargent
It looks to me like you want Dennis's #2. Lauch a mailer script from a trigger function. (Function can be any language you're familiar with including pgsql if you wish to take advantage of "\! your-mail-script" Jan Verheyden wrote: Hi, I got a bit stuck... I was looking for a solution f