Re: [GENERAL] SQL query question

2006-06-21 Thread Gurjeet Singh
Another way is to use correlated-subqueries (refrencing outer query's columns inside a subquery; hope this feature is supported): select * fromFileVersionHistory H1 where modificationDate = ( select max(modificationDate) fromFileVersionHistory H2

Re: [GENERAL] SQL query question

2006-06-18 Thread Bruno Wolff III
On Sat, Jun 17, 2006 at 16:50:59 -0700, Kevin Jenkins <[EMAIL PROTECTED]> wrote: > For example > > filename date revision > file110/05/06 1 > file110/05/07 2 > file210/05/08 1 > > I want to do a query that will return the greatest date for each > unique filename If the revisi

Re: [GENERAL] SQL query question

2006-06-17 Thread Michael Glaesemann
On Jun 18, 2006, at 8:50 , Kevin Jenkins wrote: I have a beginner question. I have a table with a bunch of filenames and each of them have a date. Multiple files may have the same name. For example filename date revision file110/05/06 1 file110/05/07 2 file210/05/08 1 I

Re: [GENERAL] SQL query question

2005-02-03 Thread Markus Schulz
Am Donnerstag, 3. Februar 2005 08:32 schrieb Uwe C. Schroeder: > Maybe it's to late for me to think correctly (actually I'm sure of > that). I'm going to ask anyways. > I have a table like > > id int4 > user_id int4 > photo varchar > image_type char(1) > > where image_type is either G or X > What I

Re: [GENERAL] SQL query question

2005-02-03 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-02-02 23:32:28 -0800: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > Maybe it's to late for me to think correctly (actually I'm sure of > that). I'm going to ask anyways. I have a table like > > id int4 > user_id int4 > photo varchar > image_type char(1) > >

Re: [GENERAL] SQL query question

2005-02-03 Thread Jonel Rienton
Hi Uwe, I did a solution for you using PLPgSQL, create or replace function countem() returns varchar as $$ declare gcount integer; xcount integer; result varchar; begin select count(*) into gcount from pix where image_type = 'G'; select count(*) into xcount

Re: [GENERAL] SQL query question

2005-02-03 Thread Jonel Rienton
you're right it's late, i better to get to bed myself, i forgot to throw in the parameter for the user_id in there, i'm sure you can figure that one out. regards, - Jonel Rienton http://blogs.road14.com Software Developer, *nix Advocate On Feb 3, 2005, at 1:32 AM, Uwe C. Schroeder wrote: ---

Re: [GENERAL] SQL query question

2004-12-22 Thread Tomasz Myrta
Hi all, I have 2 tables, with a 1-n relation: parent( oid, parent_name) child(oid, child_name, iod_parent) How do I get the parent_names of all parents without a child? select parent_name from parent left join child on (parent.oid=child.iod_parent) where child.oid is null; or select parent_name