[SQL] Simple Query HELP!!!

2001-09-27 Thread Paolo Colonnello
Hello, I have the following, A table call People with 3 fields AGE (Int) NAME (Txt) COMPANY (TxT) and I want to create a query than get me a list with the seniors per company, for example : table PEOPLE NAME AGE COMPANY Bob 33 Acme Jane30 Acme Bill20 Acme Jose

[SQL] A simple join question that may stump you

2001-09-27 Thread Ross Smith
OK, I have 2 tables, table A: ID FLAG - - 1 1 2 1 2 2 3 1 3 2 3 3 and table B: FLAG - 1 2 I want to find all id's from table A that have every flag in table B but no extra flags. So, I'd end up with: ID -

[SQL] HP-UX 11.0 postgres compile error!

2001-09-27 Thread Youn-Oh, Jung
Cannot compile Postgres .7.x with gcc 2.9.6 (OS: HP-UX 11.0). error messages: .. .. gmake[3]: Entering directory `/home/download/postgresql-7.0.2/src/backend/access/common' gcc -I../../../include -I../../../backend -D_REENTRANT -I/usr/local/Berkeley DB.3.2/include

Re: [SQL] Subquery with IN or EXISTS

2001-09-27 Thread A. Mannisto
Carl van Tast [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... 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

Re: [SQL] getting some tech skills?

2001-09-27 Thread Andy Hibbins
Larry Holt wrote: It really depends upon what kind of work you like to do. For system admin, network engineering, etc. you need scripting like SED AWK, PERL plus O/S commands. To be a programmer you need a language that can be compiled: C, Java. A programmer usually does not need to parse

Re: [SQL] Simple Query HELP!!!

2001-09-27 Thread Bob Barrows
On 22 Sep 2001 19:18:10 -0700, [EMAIL PROTECTED] (Paolo Colonnello) wrote: Hello, I have the following, A table call People with 3 fields AGE (Int) NAME (Txt) COMPANY (TxT) and I want to create a query than get me a list with the seniors per company, for example : table PEOPLE NAME AGE

Re: [SQL] Selecting latest value II

2001-09-27 Thread Carl van Tast
Hi, Thurstan On Thu, 20 Sep 2001 17:30:46 +0100, Thurstan R. McDougle [EMAIL PROTECTED] wrote: [...] Carl van Tast had 2 good methods as follows SELECT userid, val FROM tbl WHERE NOT EXISTS (SELECT * FROM tbl AS t2 WHERE tbl.userid=t2.userid AND t2.ts tbl.ts); or SELECT

Re: [SQL] Simple Query HELP!!!

2001-09-27 Thread Paolo Colonnello
[EMAIL PROTECTED] (Bob Barrows) wrote in message news:[EMAIL PROTECTED]... Do you care about ties? What if Ingrid, 38 yrs old, worked at IBM? Would you want to show both Ingrid and Maria? If so, this will work: Select Name From People t1 Inner Join (Select Company, Max(Age) As Oldest FROM

[SQL] How to get BLOB length?

2001-09-27 Thread Oleg Olenin
Is it any getlargeobject(oid) analog? ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

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

2001-09-27 Thread A. Prins
This is one way that comes up: select id from ( select distinct a.id AS id , b.flag AS flag from A, B where a.flag = b.flag ) a_distinct where id not in (select id from a where flag not in (select flag from b)) group by id having count(*) = (select

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

2001-09-27 Thread Josh Berkus
Ross, ID FLAG - - 1 1 2 1 2 2 3 1 3 2 3 3 and table B: FLAG - 1 2 I want to find all id's from table A that have every flag in table B but no extra flags. So, I'd end up with: ID - 2

[SQL] PARSER ERROR persists ....

2001-09-27 Thread Frederick Klauschen
Hi, I have tried Carl's suggestion, but it does not make a difference and the same ERROR: parser: parse error at or near ( results. I have rebuilt and reinstalled Version 7.1.3, but still the same. No compilation or installation errors are reported and simple statements seem to work properly. In

Re: [SQL] A bug in triggers PG 7.1.3 or misunderstand ?

2001-09-27 Thread Tom Lane
I think you need return old, not return new, in the body of the trigger if you want the delete to take place. new would be NULL in a delete situation ... regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked

Re: [SQL] LEFT OUTER JOIN problem

2001-09-27 Thread Josh Berkus
Ludek, I have this problem (maybe only in my head ;o)): Yup. Or it's a language problem. There's a fair Czech community of PgSQL users, so hopefully you can get in touch with some of them. (Your English is better than any of my 2nd languages -- it's just that techincal docs are hard

Re: [SQL] LEFT OUTER JOIN problem

2001-09-27 Thread Stephan Szabo
On Fri, 21 Sep 2001, Ludek Finstrle wrote: Hello, I have this problem (maybe only in my head ;o)): table1: --- id | name - 1 | 'blabla' 2 | 'arrrgh' table2: --- id | table1_id | name - 1 | 1 | 'hello' table3: --- id |

[SQL] A bug in triggers PG 7.1.3 or misunderstand ?

2001-09-27 Thread Domingo Alvarez Duarte
I have this database and it was working with PG 7.1.2 !!! When I try to delete a record the trigger is fired but the delete is not executed. ---code start here drop database test_trig; create database test_trig; \connect test_trig -- -- TOC Entry ID 2 (OID

[SQL] how can i return multiple values from a function

2001-09-27 Thread srinivas
i have tried retrieving multiple values using setof function but i couldnt solve it.when i am trying using setof iam getting this as output. 1 CREATE FUNCTION hobbies (varchar) RETURNS SETOF bank 2 AS 'SELECT * FROM bank 3 ' 4 LANGUAGE 'sql'; ~

[SQL] Aggregate Aggravation

2001-09-27 Thread Robin's PG-SQL List
I have a query using the SUM() function that is not returning the appropriate results. There are 3 queries with results below. Query 1 is the type of query I'd like to use, that has the SUM() function and a join with a customer table (bolcustomer) to constrain the results to a particular

Re: [SQL] HP-UX 11.0 postgres compile error!

2001-09-27 Thread Tom Lane
Why are you using PG 7.0.2? 7.1.3 is the current release. regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

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

2001-09-27 Thread Haller Christoph
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

[SQL] Problem in connection using .odbc.ini

2001-09-27 Thread meghana mande
Hi, I have a problem connecting to the database using .odbc.ini file. The error is: SQLState = 28000 errorMessage:[Sybase][ODBC Driver][Adaptive Server Anywhere]Invalid user authorization specification:Password must be atleast ??? characters The program executes properly if the .odbc.ini

[SQL] LEFT OUTER JOIN problem

2001-09-27 Thread Ludek Finstrle
Hello, I have this problem (maybe only in my head ;o)): table1: --- id | name - 1 | 'blabla' 2 | 'arrrgh' table2: --- id | table1_id | name - 1 | 1 | 'hello' table3: --- id | table2_id | name - SELECT * FROM table1 LEFT

Re: [SQL] PARSER ERROR persists ....

2001-09-27 Thread Tom Lane
Frederick Klauschen [EMAIL PROTECTED] writes: I have rebuilt and reinstalled Version 7.1.3, but still the same. No compilation or installation errors are reported and simple statements seem to work properly. In contrast to 7.0.3, the \d table command does not work because

Re: [SQL] Aggregate Aggravation

2001-09-27 Thread Tom Lane
Robin's PG-SQL List [EMAIL PROTECTED] writes: I have a query using the SUM() function that is not returning the appropriate results. I'm guessing that you have two rows in bolcustomer matching bol_number = 88738, so that the 14 gets added in twice. regards, tom lane

[SQL] format timestamp

2001-09-27 Thread Laurette Cisneros
Hi all, Is there a way to specify the default format for a timsetamp field? Specifically, what I am trying to do is to use COPY to get the data out of a table to be loaded into another database. I would like the timestamp fields accuracy to be maintained (to at least 3 places for