Re: [SQL] Help to simplify sample query

2004-03-09 Thread Daniel Henrique Alves Lima
Tomasz Myrta wrote: Can you try this query ? : select cd_area from area a1 join teacher_course c2 using (cd_course) where (cd_teacher,cd_course) in (select 1,2 union select 98,45 union select 11,0); Tomasz, the "in" in the query above will work like an "or" ((cd_teacher=1,cd_course=2) or (c

Re: [SQL] Help to simplify sample query

2004-03-09 Thread Daniel Henrique Alves Lima
How about this: select cd_area from area a1 where not exists ((select 1,2 union select 98,45 union select 11,0) except select c2.cd_teacher,c2.cd_course from teacher_course c2 where c2.cd_course=a1.course) ? Tom Lane wrote: Daniel Henrique Alves Lima <[EMAIL PROTECTED]> writes: I

Re: [SQL] Trying to make efficient "all vendors who can provide all items"

2004-03-09 Thread terry
Of all the proposed solutions, this appears to run the fastest, and not require the creation of an additional table. Thanks! Terry Fielder Manager Software Development and Deployment Great Gulf Homes / Ashton Woods Homes [EMAIL PROTECTED] Fax: (416) 441-9085 > -Original Message- > From:

[SQL] currval() without specifying the sequence name

2004-03-09 Thread ow
Hi, Is there a way to retrieve the current value (i.e. the last used value) of the last used sequence without specifying the sequence name? Something like the following: create table ( id serial, value varchar(10)); insert into someOthertest (value) values ('100'); insert into test (value) values

Re: [SQL] currval() without specifying the sequence name

2004-03-09 Thread Achilleus Mantzios
O kyrios ow egrapse stis Mar 9, 2004 : > Hi, > > Is there a way to retrieve the current value (i.e. the last used value) of the > last used sequence without specifying the sequence name? Something like the > following: > > create table ( id serial, value varchar(10)); > insert into someOthertest

Re: [SQL] currval() without specifying the sequence name

2004-03-09 Thread ow
--- Achilleus Mantzios <[EMAIL PROTECTED]> wrote: > > You could use the same sequence in many tables. > I guess I could but then: 1) I'd still have to know the sequence name. When integrating pgSql with 3party frameworks I'd either have to pass it there (could be a very difficult task) or make

Re: [SQL] Trying to make efficient "all vendors who can provide all items"

2004-03-09 Thread Michael Glaesemann
Just one more to add to the pile. Got it from Celko's "SQL for Smarties", under the relational division section. I'd make a temporary table for the items on the list. CREATE TEMP TABLE select_items ( item_id foo NOT NULL UNIQUE REFERENCES items(item_id) ); SELECT DISTINCT vi1.ven

Re: [SQL] currval() without specifying the sequence name

2004-03-09 Thread Achilleus Mantzios
O kyrios ow egrapse stis Mar 9, 2004 : > > --- Achilleus Mantzios <[EMAIL PROTECTED]> wrote: > > > > You could use the same sequence in many tables. > > > > I guess I could but then: > > 1) I'd still have to know the sequence name. When integrating pgSql with 3party > frameworks I'd either ha

Re: [SQL] currval() without specifying the sequence name

2004-03-09 Thread Richard Huxton
On Tuesday 09 March 2004 13:50, ow wrote: > Hi, > > Is there a way to retrieve the current value (i.e. the last used value) of > the last used sequence without specifying the sequence name? Something like > the following: > > create table ( id serial, value varchar(10)); > insert into someOthertest

Re: [SQL] Dramatic slowdown of sql when placed in a function

2004-03-09 Thread Jeff Boes
At some point in time, [EMAIL PROTECTED] (Mike Moran) wrote: >Hi. I currently have a fairly large query which I have been optimizing >for later use in a function. There are things in the query which I >have been keeping constant whilst optimizing, but which are variables >in the function. When I r

Re: [SQL] currval() without specifying the sequence name

2004-03-09 Thread Tom Lane
ow <[EMAIL PROTECTED]> writes: > I guess I could but then: > 1) I'd still have to know the sequence name. When integrating pgSql > with 3party frameworks I'd either have to pass it there (could be a > very difficult task) or make some assumptions (also not very good). This scenario is really enti

Re: [SQL] currval() without specifying the sequence name

2004-03-09 Thread ow
--- Tom Lane <[EMAIL PROTECTED]> wrote: > or that the last one that's touched is the one you want? Correct. __ Do you Yahoo!? Yahoo! Search - Find what you’re looking for faster http://search.yahoo.com ---(end of broadcast)---

Re: [SQL] Help to simplify sample query

2004-03-09 Thread Daniel Henrique Alves Lima
Where can i find the documentation about "except" or "textcat" ? I've looked at html docs in my machine (i've a 7.34 copy) and i couldn't found information/sample of them. Thanks. ---(end of broadcast)--- TIP 7: do

Re: [SQL] Help to simplify sample query

2004-03-09 Thread Bruno Wolff III
On Tue, Mar 09, 2004 at 17:13:37 -0300, Daniel Henrique Alves Lima <[EMAIL PROTECTED]> wrote: >Where can i find the documentation about "except" or "textcat" ? > I've looked at html docs in my machine (i've a 7.34 copy) and i > couldn't found information/sample of them. except should be

Re: [SQL] bytea or blobs?

2004-03-09 Thread Richard Huxton
On Tuesday 09 March 2004 18:33, you wrote: > Hi. If it wouldn't be too much of a bother could you send me sample code > that used SQL commands to insert a bytea as well as retrieve, that includes > the encode / decode stuff? I have been struggling to figure out how to get > this to work. I am us

[SQL] correlated multi-set update?

2004-03-09 Thread Marty Scholes
Hello, My company recently deployed Pg 7.4.1. on Solaris for an experimental project and is using the experience to evaluate its viability for migration from Oracle 7.0. While I like a lot of the features of Pg, one thing I noticed that "seems" to be missing is the ability to set multiple fiel

Re: [SQL] Dramatic slowdown of sql when placed in a function

2004-03-09 Thread Mike Moran
Jeff Boes <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > At some point in time, [EMAIL PROTECTED] (Mike Moran) wrote: > > >Hi. I currently have a fairly large query which I have been optimizing > >for later use in a function. There are things in the query which I > >have been k

Re: [SQL] correlated multi-set update?

2004-03-09 Thread Stephan Szabo
On Tue, 9 Mar 2004, Marty Scholes wrote: > Hello, > > My company recently deployed Pg 7.4.1. on Solaris for an experimental > project and is using the experience to evaluate its viability for > migration from Oracle 7.0. > > While I like a lot of the features of Pg, one thing I noticed that > "se

[SQL] Converting query to view - duplicate fields

2004-03-09 Thread Richard Grosse
Hello, Trying to convert the query below to a view. The problem is despite it working as a query when trying to save it as a view the database returns the error that the field tablealias.cmpname is duplicated. (Which it is and has to be) So how to a refer to the same table more than once and get

Re: [SQL] Converting query to view - duplicate fields

2004-03-09 Thread Stephan Szabo
On Tue, 9 Mar 2004, Richard Grosse wrote: > Trying to convert the query below to a view. The problem is > despite it working as a query when trying to save it as a > view the database returns the error that the field tablealias.cmpname > is duplicated. (Which it is and has to be) You're going to

[SQL] pg_hba.conf

2004-03-09 Thread azwa
Hi, i try to connect to my database as $ psql dwnc biosadm but got the error "psql: FATAL: No pg_hba.conf entry for host localhost, user biosadm, database dwnc" Below are the detail in pg_hba.conf # TYPE DATABASEUSERIP-ADDRESSIP-MASK METHOD local

Re: [SQL] correlated multi-set update?

2004-03-09 Thread Bruno Wolff III
On Tue, Mar 09, 2004 at 14:48:57 -0700, Marty Scholes <[EMAIL PROTECTED]> wrote: > > While I like a lot of the features of Pg, one thing I noticed that > "seems" to be missing is the ability to set multiple fields in an update > using a correlated subquery. You can't set more than one column

Re: [SQL] pg_hba.conf

2004-03-09 Thread azwa
Hi,    by the way i've settle my connection problem between client application and server itself . this is happen because of editing the parameter in pg_hba.conf while the environment(database was running) was active.  tq [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 12:12 PM Today  

[SQL] Database reporting tool

2004-03-09 Thread azwa
Hi,   i'm using PostgreSQL as my database and now i'm looking for a good reporting tools(can do ad-hoc queries & ease of use)  that can connect to several database instead of PostgreSQL. thanks in advance

Re: [SQL] Database reporting tool

2004-03-09 Thread Jerome Alet
On Wed, Mar 10, 2004 at 02:17:31PM +0800, [EMAIL PROTECTED] wrote: > > i'm using PostgreSQL as my database and now i'm looking for a good > reporting tools(can do ad-hoc queries & ease of use) > that can connect to several database instead of PostgreSQL. > thanks in advance see : http://www.