Re: [SQL] Help on some SQL command...

2000-08-17 Thread Jesus Aneiros
Use default now() -- Jesus Aneiros Sosa mailto:[EMAIL PROTECTED] http://jagua.cfg.sld.cu/~aneiros On Wed, 16 Aug 2000, Ang Sei Heng wrote: > Hello to all the SQL gurus... > > I have this little table: > > test1 ( > id char(8) primary key, >

RE: [SQL] Use a rule or a transaction

2000-08-15 Thread Jesus Aneiros
Create a trigger on module before update or insert. The philosophy of postgres is to create a trigger based on a function previously created. Take a look at the docs, the part on procedural languages. The book from Momjian has one or two examples on triggers creation. -- Jesus Aneiros Sosa

Re: [SQL] % escape

2000-08-15 Thread Jesus Aneiros
To escape % use \\% as in '50\\%', to escape ' use '' as in 'o''conell', retrieves o'conell Regards. -- Jesus Aneiros Sosa mailto:[EMAIL PROTECTED] http://jagua.cfg.sld.cu/~aneiros On Tue, 15 Aug 2000, Jie Liang wrote: > Hi,there, >

Re: [SQL] Functions with Null Arguments?

2000-08-15 Thread Jesus Aneiros
eturn foo.name1; else return foo.name2; end if; end;' language 'plpgsql'; -- Jesus Aneiros Sosa mailto:[EMAIL PROTECTED] http://jagua.cfg.sld.cu/~aneiros On Tue, 15 Aug 2000, Thomas Swan wrote: > > Is there anyway way to get the following to work? &

Re: [SQL] data integrity

2000-08-15 Thread Jesus Aneiros
On Tue, 15 Aug 2000, Sandis wrote: > there is a db with a few tables that have related (joined) fields. if > record in a one table (auxiliary) gets deleted (along with it's I would say this is the primary table. > primary key), reference to it in another table (main) points to And this is the

RE: [SQL] select an entry with a NULL date field

2000-08-14 Thread Jesus Aneiros
I think undefined is the exact result for that comparison, therefore the returned error. False value will not be an error. -- Jesus Aneiros Sosa mailto:[EMAIL PROTECTED] http://jagua.cfg.sld.cu/~aneiros On Mon, 14 Aug 2000, Henry Lafleur wrote: > Comparing anything = NULL (if it would w

Re: [SQL] select an entry with a NULL date field

2000-08-14 Thread Jesus Aneiros
Use select entry_id from tbl_date where date_02 is null; NULL = NULL is undefined according to SQL standards. -- Jesus Aneiros Sosa mailto:[EMAIL PROTECTED] http://jagua.cfg.sld.cu/~aneiros On Mon, 14 Aug 2000, Web Manager wrote: > ERROR: parser: parse error at or near "null&qu

Re: [SQL] Operator Precedence problem?

2000-08-13 Thread Jesus Aneiros
The ANSI/ISO standard specifies that NOT has the highest priority, then AND and finally OR. -- Jesus Aneiros Sosa mailto:[EMAIL PROTECTED] http://jagua.cfg.sld.cu/~aneiros On Sat, 12 Aug 2000, Philip Warner wrote: > > I have a peculiar problem that I can't reproduce on a trivi

[SQL] RULES on PostgreSQL

2000-07-24 Thread Jesus Aneiros
Hello all, Forgive my ignorance. I'm trying to understand the RULES in PostgreSQL and I have several questions. Why the rules if they are not part of SQL92 or SQL3? Where do they come from? Are they from before the SQL history of Postgres? Many things that can be done with RULES can be done with

Re: [SQL] Group BY ...(cont.)

2000-07-05 Thread Jesus Aneiros
No, you don't you could say: SELECT workgroup, id FROM job GROUP BY workgroups; On Wed, 5 Jul 2000, Antti Linno wrote: > Ok, if I want to use group by, then I have to put every select field > afterwards to group by. But I do want to group by one field. > Hence > select workgroup,id from job gro

Re: [SQL] GROUP by

2000-07-05 Thread Jesus Aneiros
You can use group by without having an aggregate operator but if you use an aggregate you have to put the group by column int the select. By the way what is after the AND? I hope it is not another workgroup condition because it doesn't have much sense, I think. If you are filtering different type

Re: [SQL] eliminating duplicates in results..

2000-06-22 Thread Jesus Aneiros
SELECT DISTINCT On Wed, 21 Jun 2000, Francisco Hernandez wrote: > hello everyone, > i have a query like so: > > select item.type as ig_id,item.with_design,item_group.type as > group_name, 'true' as valid from item,item_group where item.description > ~* 'w/out' and item.type = item_group.ig_id;

Re: [SQL] Problem regarding 'select...as...'

2000-06-12 Thread Jesus Aneiros
I think the correct way is SELECT equipo_attr[1] AS year, equip_attr[2] AS make FROM vehicle_tb; On Mon, 12 Jun 2000, Bernie Huang wrote: > Hi, I have a following query: > > "select equip_attr[1], equip_attr[2] > as year, make > from vehicle_tb;" > > which gives me the following error: > >

Re: [SQL] Outer join in postgresql

2000-06-12 Thread Jesus Aneiros
There is no OUTER JOIN in postgres. You could use SELECT and UNION ALL. Jesus. On Mon, 12 Jun 2000, Patrick Kay wrote: > I am looking for a way run an outer join in psql. Can anyone help? > > Informix has an "OUTER" keyword. I don't see anything like this in the docs > for psql. > > Thanks