Re: Query does not work: parse ERROR, Re: [SQL] How to enter lists into database: Problems with solution.

2001-09-26 Thread Josh Berkus
Frederick, > I am really sorry to bother you again and I promise > to buy a book after this problem is solved and > stop asking these "beginners'" questions. Nah, this one wasn't a beginners question. Intermediate, maybe. > But the last example-Query you sent me does not > work, it produces: >

[SQL] PARSER ERROR

2001-09-26 Thread Frederick Klauschen
The commas did not get cut off and I think I did not make any other mistakes either. Is it also possible that the parser does not work properly? Thanks, Frederick Here is what happened again: ERROR: parser: parse error at or near "(" when running : > SELECT people.people_id, people.name, >

Re: [SQL] Query does not work: parse ERROR, Re: How to enter lists into database: Problems with solution.

2001-09-26 Thread Carl van Tast
Hi Frederick, On Wed, 26 Sep 2001 19:08:59 + (UTC), [EMAIL PROTECTED] (Frederick Klauschen) wrote: >Hi Josh, > >I am really sorry to bother you again and I promise >to buy a book after this problem is solved and >stop asking these "beginners'" questions. >But the last example-Query you sent

Re: [SQL] Subquery with IN or EXISTS

2001-09-26 Thread Carl van Tast
Hi A., On 26 Sep 2001 07:24:41 -0700, [EMAIL PROTECTED] (A. Mannisto) wrote: >Hello, > >does anybody know why this: >SELECT * FROM tab WHERE col1 IN (SELECT col2 FROM TAB2) > >equals this: >SELECT * FROM tab WHERE EXISTS (SELECT col2 FROM TAB2 WHERE col1 = >col2) > >but this: >SELECT * FROM tab

Re: [SQL] A simple join question that may stump you

2001-09-26 Thread Thurstan R. McDougle
How about:- SELECT id FROM (a LEFT JOIN b WHERE a.flag=b.flag) GROUP BY id HAVING ((COUNT(*)=COUNT(b.flag)) AND (COUNT(*)=(SELECT COUNT(*) FROM b AS b_cnt))); This relys on COUNT(field) not counting NULLs, and that NULL is what the LEFT JOIN returns for an absent b.flag:-

[SQL] is it possible to get the number of rows of a table?

2001-09-26 Thread Frederick Klauschen
I would like to compare the number of rows of one table and of another and use it in a query like this: SELECT * FROM WHERE "number of rows of table " EQUALS "number of rows of table " i.e. I only want get a query result if the tables have the s

Re: [SQL] is it possible to get the number of rows of a table?

2001-09-26 Thread Wei Weng
This should be really easy to implement in a function yourself. And I don't think there is already something similar in pgsql. == Wei Weng Network Software Engineer KenCast Inc. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Frederick Kl

Re: [SQL]plpgsql function case statement

2001-09-26 Thread Masaru Sugawara
Peter Schmidt wrote: >I'm having trouble finding the best solution for the following plpgsql >function. >The function does the following: Hi, I post in this mailing list for the first time. :-) I think your pl/pgsql function runs properly, but there is likely to exist another SQL pattern. In

Re: [SQL] How to enter lists into database: Problems with solution.

2001-09-26 Thread Josh Berkus
Frederick, > "Mary Stuart" correctly. But such a query also > seems to get results that contain only one > of the search_attributes. > e.g. a 32 "Peter Smith" who e.g. just has an entry > 24 32 "hair" "brown" (and no mice hobby) is also > found. > I need to get only results that match the search

Query does not work: parse ERROR, Re: [SQL] How to enter lists into database: Problems with solution.

2001-09-26 Thread Frederick Klauschen
Hi Josh, I am really sorry to bother you again and I promise to buy a book after this problem is solved and stop asking these "beginners'" questions. But the last example-Query you sent me does not work, it produces: ERROR: parser: parse error at or near "(" and I am sure, I entered it correctl

Re: [SQL] CHECK problem really OK now...

2001-09-26 Thread Tom Lane
Kovacs Baldvin <[EMAIL PROTECTED]> writes: > I tried, and it works: the current CVS version really runs > happily the query what sent to heaven our 7.1 version of the > backend. I believe this traces to a fix I made in May: 2001-05-27 16:48 tgl * src/: backend/executor/execJunk.c, back