[SQL] Subqueries returning more than one value?

2004-05-10 Thread Adam Witney
Hi, I am using a function in a subquery, this works ok: SELECT name, (SELECT p_my_func(1)) AS id FROM test; However I would like to have the function return 2 values into the main query... Something like this: SELECT name, (SELECT p_my_func(1)) AS (id, type) FROM test; Of course this give

Re: [SQL] double left outer join on the same table

2004-05-02 Thread Adam Witney
On 2/5/04 5:23 pm, "T E Schmitz" <[EMAIL PROTECTED]> wrote: > Hello, > > I have two tables SECTION and BRAND. SECTION is related to BRAND via two > foreign keys. I would like to select ALL SECTIONs whether the FKs are > null or not and fetch the BRAND attributes in one SQL statement. In > other w

Re: [SQL] pgdump by schema?

2005-02-02 Thread Adam Witney
From: pg_dump --help -n, --schema=SCHEMA dump the named schema only > Is there a way to dump everything in a particular schema? > > > Bradley Miller > NUVIO CORPORATION > Phone: 816-444-4422 ext. 6757 > Fax: 913-498-1810 > http://www.nuvio.com > [EMAIL PROTECTED] -- This message has

[SQL] Complex SQL query and performance strategy

2002-10-09 Thread Adam Witney
Hi, I have a complex SQL query which requires the joining of 18 tables. There are only primary key indices on the table and at the moment it runs a little slow (30s or so) and so I am trying to optimise it. The output of EXPLAIN is a little confusing and seems to vary from run to run. Does the

Re: [SQL] Creating Stored Procedures

2002-10-30 Thread Adam Witney
> I installed 7.3beta3 but how do I do it now? > How do I make a function that returns a dataset > > Greets > Zertox He is an email I received from Joe Conway on the subject a month or so ago > Adam Witney wrote: >> There have been a few emails recently concerning us

Re: [SQL] SQL list table names

2003-01-07 Thread Adam Witney
If you start psql like so psql -E Then all the SQL behind the \d type commands is displayed for you. adam > is it possible to execute an sql query to be able to list the tables's > names? > well, you can do it on psql using \dt. but im talking about the SQL > statement, because i want to exec

Re: [SQL] Inherancing

2003-01-07 Thread Adam Witney
On 7/1/03 11:42 am, "Nasair Junior da Silva" <[EMAIL PROTECTED]> wrote: > Hi people, > supposing i have the tables : > > create table cities (id int, name varchar, primary key(id) ); > create table centers (state varchar(2)) inherits (cities); > > ant the tuple > insert into cities values (1, 'L

Re: [SQL] Inherancing

2003-01-07 Thread Adam Witney
om cities; > i'll have two tuples with the name 'Lajeado'. > > Does it the only way i have ? > > Thanks again, > > Nasair JĂșnior da Silva > Lajeado - RS - Brasil. > > Em Tue, 07 Jan 2003 12:02:13 +, Adam Witney <[EMAIL PROTECTED]> > escreveu: >

Re: [SQL] Is it possible to connect to another database

2003-07-17 Thread Adam Witney
Take a look at dblink in the contrib directory... This may do what you need adam > Hi, > > I try to find how is it possible to connect 2 databases, with a symbolic > link. > > I have to use tables in another database to test user or other information. > > > Ben > > > > > ---

[SQL] query or design question

2003-10-20 Thread Adam Witney
Hi, I have a table like so CREATE TABLE imagene ( id int bioassay_idint gene_idtext s_row int s_column int s_meta_row int s_meta_column int sig_median numeric bkg_median numeric ); Rows are unique on (bioassay_id, gene_id, s_row, s_column, s_me

[SQL] Crosstab question

2003-10-20 Thread Adam Witney
Hi, I am trying to figure out the use of crosstab(text sql, int N) The sql I have is cabbage=# select geneid, bioassay_id, sig_median from imagene order by 1,2; geneid | bioassay_id | sig_median -+-+ 16s rRNA (AP

Re: [SQL] how to create a multi columns return function ?

2003-10-21 Thread Adam Witney
Take a look at the section on 'SQL Functions Returning Sets' http://www.postgresql.org/docs/7.3/static/xfunc-sql.html#AEN31304 > Hi > > I'm moving databases from sybase to postgres. > But I have difficulties in creating a postgres equivalent to the sybase stored > procedures... > > Appare

[SQL] which is better: using OR clauses or UNION?

2011-08-16 Thread Adam Witney
Hi, I have a query hitting a table of 25 million rows. The table has a text field ('identifier') which i need to query for matching rows. The question is if i have multiple strings to match against this field I can use multiple OR sub-statements or multiple statements in a UNION. The UNION see