Re: [GENERAL] What's wrong with this query?

2010-09-22 Thread Tom Lane
Mike Christensen writes: > So are you saying that a JOIN can only refer to itself and the last > table on the FROM list? Um, I think you've got the wrong mental model of the syntax. JOIN is a binary operation between two tables: tab1 JOIN tab2 ON some-condition-involving-tab1-and-tab2-o

Re: [GENERAL] What's wrong with this query?

2010-09-22 Thread Mike Christensen
Hi Tom, sorry to be a total n00b, but can you give me a few more pointers? I've noticed if I swap the two "tables" around, like: FROM plainto_tsquery('quiche') query, Recipes R then it works.. So are you saying that a JOIN can only refer to itself and the last table on the FROM list? I actuall

Re: [GENERAL] What's wrong with this query?

2010-09-17 Thread Tom Lane
Mike Christensen writes: > Here's the query: > SELECT R.RecipeId, R.Title, R.Description, R.ImageUrl, R.Rating, > R.PrepTime, R.CookTime, R.OwnerId, U.Alias, ts_rank_cd(R.TextSearch, > query) as Rank > FROM Recipes R, plainto_tsquery('veggie burgers') query > INNER JOIN Users U ON U.UserId = R.Own

Re: [GENERAL] What's wrong with this query?

2009-06-22 Thread Thomas Kellerer
Albe Laurenz, 22.06.2009 09:52: Sorry to be nitpicking, but maybe in that case it adds to clarity: A comparison with NULL does not return FALSE, but "undefined" or NULL. Try to run the following queries: SELECT 1 = 2; and SELECT 1 = NULL; and observe the different result. In the context of t

Re: [GENERAL] What's wrong with this query?

2009-06-22 Thread Albe Laurenz
Thomas Kellerer wrote: >> CREATE TABLE test >> ( >> value uuid >> ); >> >> INSERT INTO test VALUES ('----'); >> INSERT INTO test VALUES ('----'); >> INSERT INTO test VALUES (null); >> >> select * from test where value != '-

Re: [GENERAL] What's wrong with this query?

2009-06-21 Thread Mike Christensen
ns accepter > aucune responsabilité pour le contenu fourni. > > > > > > > -- > Date: Sun, 21 Jun 2009 18:43:42 -0700 > Subject: Re: [GENERAL] What's wrong with this query? > From: m...@kitchenpc.com > To: mgai...@hotmail.com >

Re: [GENERAL] What's wrong with this query?

2009-06-21 Thread Martin Gainty
fourni. > To: pgsql-general@postgresql.org > From: spam_ea...@gmx.net > Subject: Re: [GENERAL] What's wrong with this query? > Date: Mon, 22 Jun 2009 00:37:41 +0200 > > Mike Christensen wrote on 22.06.2009 00:10: > > I just tracked down a bug in my software due t

Re: [GENERAL] What's wrong with this query?

2009-06-21 Thread Mike Christensen
pas > n'importe quel effet légalement obligatoire. Étant donné que les email > peuvent facilement être sujets à la manipulation, nous ne pouvons accepter > aucune responsabilité pour le contenu fourni. > > > > > > > > To: pgsql-general@postgresql.org

Re: [GENERAL] What's wrong with this query?

2009-06-21 Thread Martin Gainty
lement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. > To: pgsql-general@postgresql.org > From: spam_ea...@gmx.net > S

Re: [GENERAL] What's wrong with this query?

2009-06-21 Thread Steve Atkins
On Jun 21, 2009, at 3:37 PM, Thomas Kellerer wrote: Mike Christensen wrote on 22.06.2009 00:10: I just tracked down a bug in my software due to an "unexpected" behavior in Postgres.. Can someone clarify why this doesn't work (I haven't tried it on MSSQL or anything else, so I'm not sure if

Re: [GENERAL] What's wrong with this query?

2009-06-21 Thread Thomas Kellerer
Mike Christensen wrote on 22.06.2009 00:10: I just tracked down a bug in my software due to an "unexpected" behavior in Postgres.. Can someone clarify why this doesn't work (I haven't tried it on MSSQL or anything else, so I'm not sure if this is the official SQL standard or anything).. CREA

Re: [GENERAL] what's wrong with this query

2001-02-11 Thread Alex Pilosov
On Sun, 11 Feb 2001, Thomas T. Thai wrote: > still trying to port this app from mysql to pgsql, but getting this error: > > Database error: Invalid SQL: select > t_stories.heading,t_stories.rid,count(*) as cmts from t_stories,t_comments > where t_comments.toprid = t_stories.rid and t_stories.ve