Re: [sqlite] Are parenthesis really needed?

2007-08-26 Thread Bruno S. Oliveira
Hi,

On 8/25/07, Joe Wilson <[EMAIL PROTECTED]> wrote:
>
> I assume you're referring to this:
>
>   http://marc.info/?l=sqlite-users=118737502703454=2
>

Yep, that's it.

> In that specific case, the parens are not needed. But that's not always
> the case. In general, LEFT OUTER JOIN is not commutative, nor is it
> associative. You cannot blindy strip the parens or reorder the outer joins
> out of context.
>

hmmm
I see.

Thanks for you attention, Joe.

Regards,
Bruno

-- 
/**
 * Bruno S. Oliveira
 * Bacharel em Ciência da Computação - UFLA
 * Mestrando em Inteligência Computacional - UFPR
 * http://www.inf.ufpr.br/brunoso/
 *
 * http://www.last.fm/user/bsoliveira/
 */


Re: [sqlite] Are parenthesis really needed?

2007-08-24 Thread Joe Wilson
--- "Bruno S. Oliveira" <[EMAIL PROTECTED]> wrote:
> Is there any sort of expression inside a query that needs to be
> surrounded by parenthesis?
> 
> My program will receive queries built to run in MySQL, Oracle and
> Postgrees. The problem, as posted before, is that SQLite has problems
> with parenthesis around JOINs...   So, what I want to do is to remove
> every possible parenthesis present in the incoming query. So that my
> problem is resolved fast.

I assume you're referring to this:

  http://marc.info/?l=sqlite-users=118737502703454=2

In that specific case, the parens are not needed. But that's not always 
the case. In general, LEFT OUTER JOIN is not commutative, nor is it 
associative. You cannot blindy strip the parens or reorder the outer joins
out of context.



   

Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, 
photos & more. 
http://mobile.yahoo.com/go?refer=1GNXIC

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Are parenthesis really needed?

2007-08-24 Thread Jim Dodgen

I don't think so:

for example logical operations need to be contained like in a ON or 
WHERE clause


example" WHERE  ((a = "X" AND b = "Y") OR z = "W") AND  x = "foo"

if you remove the parenthesis then it will evaluate differently

Bruno S. Oliveira wrote:

Hi there,

Is there any sort of expression inside a query that needs to be
surrounded by parenthesis?

My program will receive queries built to run in MySQL, Oracle and
Postgrees. The problem, as posted before, is that SQLite has problems
with parenthesis around JOINs...   So, what I want to do is to remove
every possible parenthesis present in the incoming query. So that my
problem is resolved fast.
Can I do that safely?

Thanks in advance.

Regards

  



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Are parenthesis really needed?

2007-08-24 Thread Olivier Le Floch

Won't most arithmetic expressions such as :

SELECT  (col1 + col2) * col3
  FROM  table

require parenthesis ?

Regards,

--
Olivier LE FLOCH


On 25 août 07, at 00:01, Bruno S. Oliveira wrote:


Hi there,

Is there any sort of expression inside a query that needs to be
surrounded by parenthesis?

My program will receive queries built to run in MySQL, Oracle and
Postgrees. The problem, as posted before, is that SQLite has problems
with parenthesis around JOINs...   So, what I want to do is to remove
every possible parenthesis present in the incoming query. So that my
problem is resolved fast.
Can I do that safely?

Thanks in advance.

Regards

--
/**
 * Bruno S. Oliveira
 * Bacharel em Ciência da Computação - UFLA
 * Mestrando em Inteligência Computacional - UFPR
 * http://www.inf.ufpr.br/brunoso/
 *
 * http://www.last.fm/user/bsoliveira/
 */





smime.p7s
Description: S/MIME cryptographic signature


[sqlite] Are parenthesis really needed?

2007-08-24 Thread Bruno S. Oliveira
Hi there,

Is there any sort of expression inside a query that needs to be
surrounded by parenthesis?

My program will receive queries built to run in MySQL, Oracle and
Postgrees. The problem, as posted before, is that SQLite has problems
with parenthesis around JOINs...   So, what I want to do is to remove
every possible parenthesis present in the incoming query. So that my
problem is resolved fast.
Can I do that safely?

Thanks in advance.

Regards

-- 
/**
 * Bruno S. Oliveira
 * Bacharel em Ciência da Computação - UFLA
 * Mestrando em Inteligência Computacional - UFPR
 * http://www.inf.ufpr.br/brunoso/
 *
 * http://www.last.fm/user/bsoliveira/
 */