[sqlite] I don't understand how to use NOT EXISTS

2015-09-16 Thread Nicolas Jäger
Hi, @Simon, > >CASE ( SElECT BOOL FROM _TAG_EXISTS_RESULT_ ) WHEN 0 > > CASE takes a value. You can't put a SQLite command in there. > actually, it's working if you put the command between (). I guess it's like the `` on linux (eg), mplayer `ls *.mp3` but maybe,even if it's working, you

[sqlite] I don't understand how to use NOT EXISTS

2015-09-16 Thread Keith Medcalf
> @Simon, > > > >CASE ( SElECT BOOL FROM _TAG_EXISTS_RESULT_ ) WHEN 0 > > > > CASE takes a value. You can't put a SQLite command in there. > > > actually, it's working if you put the command between (). I guess it's > like the `` on linux (eg), > > mplayer `ls *.mp3` > > but maybe,even if

[sqlite] I don't understand how to use NOT EXISTS

2015-09-16 Thread Simon Slavin
On 16 Sep 2015, at 7:27pm, Nicolas J?ger wrote: >CASE ( SElECT BOOL FROM _TAG_EXISTS_RESULT_ ) WHEN 0 CASE takes a value. You can't put a SQLite command in there. More generally, you come from a programming background and are expecting SQL to work like a programming language. It doesn't

[sqlite] bug in PRAGMA ignore_check_constraints?

2015-09-16 Thread James K. Lowden
On Fri, 11 Sep 2015 02:02:05 +0100 Simon Slavin wrote: > Looking at > > > > maybe the 'constraints' that the documentation refers to are the ones > specifically declared using CHECK in the table definition. Perhaps > NOT NULL and UNIQUE do

[sqlite] How to cast and get column type ?

2015-09-16 Thread Domingo Alvarez Duarte
Hello ! I'm writing an application that uses the column declared/type to do some formatting, it's working fine for tables and most views except when the column is calculated like: SELECT id, name, (weight / height) AS pseudo_mass? FROM people; I can get the column type of "id" and "name" b

[sqlite] I don't understand how to use NOT EXISTS

2015-09-16 Thread Nicolas Jäger
Hi guys, so there is the two ways I made: FIRST ONE: == ** Create a table wich will store the result of EXISTS, CREATE TABLE _TAG_EXISTS_RESULT_( NAME, BOOL ); ** The next query has to INSERT 'evil little sister' with BOOL to 1 in _TAG_EXISTS_RESULT_ if 'evil little sister' is already

[sqlite] sqlite3 file as database

2015-09-16 Thread Klaas V
Dear SQLite-users, R.Smith wrote: >".sqlite" is found somewhat, but if I had to pick one that seems most >common, it would just be the: "*.db" Firefox uses both database-extensions. '.sqlite' for sqlite3 , .db for another kind. I use .sqb for sqlite3 and .sqc for ciphered databases. When sqlit

[sqlite] I don't understand how to use NOT EXISTS

2015-09-16 Thread Barry Smith
If you have a unique index on name, you could use INSERT OR IGNORE. https://www.sqlite.org/lang_conflict.html INSERT OR IGNORE INTO TAGS (NAME, COUNT) VALUES ('Bleh', 1) As for your original query: think about just the select clause (you can run it independently). This will return ('magnetohydr