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
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
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
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
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
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
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
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
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);
>
[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
Is it any getlargeobject(oid) analog?
---(end of broadcast)---
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
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
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
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:
>
>
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
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
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
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
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
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
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
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:
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
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
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
>
> 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
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
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
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
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
"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
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
32 matches
Mail list logo