[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 millisecond

[SQL] simple question!

2001-09-27 Thread Esteban Gutierrez Abarzua
hi. I have a simple question! is there a command intersect? I mean exist a union command, but I don't know if exist a intersect command. thanks ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command

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

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 enou

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 l

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 checke

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 > command does not work because 'format_type(oid,i

[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

[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 fil

[SQL] TEXT in select

2001-09-27 Thread Michael Remme
Hi, does anybody know a way, how to implement the content of a field of type TEXT into a query? if i am trying: select * from testtable WHERE testTEXT LIKE '%testString%' i am getting always an empty selection, although there is a record existing. The same with select * from testt

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

[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 custo

[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'; ~ output:

[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 818

Re: [SQL] Simple Query HELP!!!

2001-09-27 Thread --CELKO--
Please write DDL and not narrative. here is my guess at what you are trying to do. What you posted was not a table because you had no key. TEXT is not the datatype to use for names -- unless they are thousand of characters long!! Recording age as an integer is useless -- give us the birthday an

[SQL] How to get BLOB size?

2001-09-27 Thread Oleg Olenin
How to get BLOB size? ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly

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: > >

[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. I

Re: [SQL] PL/PGSQL Regexe

2001-09-27 Thread rdear
Humm... 7.0.2, I'll upgrade and try again. Thanks! Tom Lane wrote: [EMAIL PROTECTED]">rdear <[EMAIL PROTECTED]> writes: I'm doing a check within a PL/PGSQL function using a regular expression and I get the error: ERROR: regcomp failed with error invalid character range This appears

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 cou

[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] 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

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); >

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] Request for book reviews/comments

2001-09-27 Thread Rick Robino
Josh, I noticed that you had a Joe Selko book in your list so I thought it would only be fair to put in a C.J. Date book as well. Perhaps: A Guide to the Sql Standard : A User's Guide to the Standard Database Language Sql by Hugh Darwen (Contributor), Chris J. Date Paperback - 572 pages 1 editi

[SQL] Subquery with IN or EXISTS

2001-09-27 Thread A. Mannisto
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 WHERE col1 IN (SELECT col2 FROM TAB2 WHERE col3='huu') equals _NOT_ this: SELECT * FROM t

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 pa

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: > >SE

[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 -I/usr/local/sr

[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 - 2

[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 Jose5

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 th