[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: SQLite and SELECT WHERE local_relpath LIKE

From: Peter Samuelson <peter_at_p12n.org>
Date: Sat, 30 Oct 2010 14:55:16 -0500

[Philip Martin]
> sqlite3 wcx.db "select count(*) from nodes where wc_id = 1 and local_relpath = 'zag1/zag27'"
>
> sqlite3 wcx.db "select count(*) from nodes where wc_id = 1 and (local_relpath > 'zig1/zag27/' and local_relpath < 'zig1/zag270')"

> sqlite3 wcx.db "select count(*) from nodes where wc_id = 1 and local_relpath = 'zig1/zag27' or (local_
relpath > 'zig1/zag27/' and local_relpath < 'zig1/zag270')"

AND has higher precedence than OR, so you want more parens:

    sqlite3 wcx.db "select count(*) from nodes where wc_id = 1 and (local_relpath = 'zig1/zag27' or (local_relpath > 'zig1/zag27/' and local_relpath < 'zig1/zag270'))"

Peter
Received on 2010-10-30 21:56:04 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.