Re: [sqlite] Left join help.

2013-04-26 Thread Danilo Cicerone
Many thanks to you all, I really appraciate your helpfulness, Danilo 2013/4/26 Clemens Ladisch > Hick Gunter wrote: > > Actually "CROSS" just forces SQLite to use the tables in the order > > specified. > > This is an SQLite optimization extension. I used CROSS because this

[sqlite] Left join help.

2013-04-26 Thread Danilo Cicerone
Hi to all, I'm looking for a query on the following schema: PRAGMA foreign_keys=ON; BEGIN TRANSACTION; CREATE TABLE subj ( sub_id INTEGER PRIMARY KEY, -- 00 sub_descr TEXT DEFAULT NULL -- 01 ); INSERT INTO "subj" VALUES(1,'Paul'); INSERT INTO "subj" VALUES(2,'John'); CREATE TABLE itx (

[sqlite] Handling error messages using ON CONFLICT clause.

2012-09-04 Thread Danilo Cicerone
Hi to all, I'd like to use a customized error message when occur a CONSTRAINT violation. The only way seems the use of RAISE() function but it's applicable only in a TRIGGER. So, if my table is: CREATE TABLE t1( a INTEGER PRIMARY KEY, b TEXT DEFAULT NULL, UNIQUE(b)); How to raise a

Re: [sqlite] How to JOIN...

2012-02-22 Thread Danilo Cicerone
22/2012 1:05 PM, Danilo Cicerone wrote: >> >> two views. According to the following SQL statement(see below) I'm >> >> going to create a table >> 'A' storing student's name, table 'B' storing courses and table D storing >> cards. >> Furthermore, it cr

Re: [sqlite] How to JOIN...

2012-02-22 Thread Danilo Cicerone
Thanks! Sigh, I need more research on JOINs I need more research on JOINs, I need more research on JOINs, I need more research on JOINs, I need more research on JOINs, I need more research on JOINs, I need more research on JOINs, I need more research on JOINs, I need more research on JOINs.

[sqlite] How to JOIN...

2012-02-22 Thread Danilo Cicerone
...two views. According to the following SQL statement(see below) I'm going to create a table 'A' storing student's name, table 'B' storing courses and table D storing cards. Furthermore, it creates two pivot tables A2B and A2D to refer courses and cards. I'd like to query the DB to get that

Re: [sqlite] SQL Statement Help(selecting days).

2011-05-18 Thread Danilo Cicerone
Amazing! Thanks a lot. 2011/5/18 Igor Tandetnik : > select startGap, min(endGap) from > ( >   select date(e1.endDate, '+1 day') startGap, date(e2.startDate, '-1 > day') endGap >   from (select startDate, endDate from events >         union all >         select '' startDate,

Re: [sqlite] SQL Statement Help(selecting days).

2011-05-18 Thread Danilo Cicerone
Thanks again. 2011/5/18 Petite Abeille <petite.abei...@gmail.com>: > > On May 18, 2011, at 10:50 PM, Danilo Cicerone wrote: > (1) materialize the calendar as a table > (2) virtualize the calendar as a generator > ___ sqlite-user

Re: [sqlite] SQL Statement Help(selecting days).

2011-05-18 Thread Danilo Cicerone
Thanks Petite, I get it, great. Only another quick question, How can I simulate a calendar table(maybe using the strftime funtion)? Danilo 2011/5/18 Petite Abeille : > > On May 18, 2011, at 10:17 PM, Pavel Ivanov wrote: > >> SQL wasn't intended for and can't solve such

[sqlite] SQL Statement Help(selecting days).

2011-05-18 Thread Danilo Cicerone
Hi to all, I need help to build a statement in order to select all days free from events in a specific time range. E.g.: - Range(-MM-DD) from 2011-01-01 to 2011-02-01. - Event 1 from 2011-01-02 to 2011-01-08 - Event 2 from 2011-01-06 to 2011-01-12 - Event 3 from 2011-01-18 to 2011-01-21

Re: [sqlite] Difference between times.

2010-10-21 Thread Danilo Cicerone
Thanks Simon, GREAT solution!!! A very interesting sintax. 2010/10/21 Simon Davies <simon.james.dav...@gmail.com> > On 21 October 2010 11:58, Danilo Cicerone <cyds...@gmail.com> wrote: > > Thanks Simon, but I've the following situation: > > > . > . > . > &

Re: [sqlite] Difference between times.

2010-10-21 Thread Danilo Cicerone
10/21 Simon Davies <simon.james.dav...@gmail.com> > On 21 October 2010 11:03, Danilo Cicerone <cyds...@gmail.com> wrote: > > Hi to all, > > I'd like to calculate hours and minutes having the following situation > where > > A and B are q

[sqlite] Difference between times.

2010-10-21 Thread Danilo Cicerone
Hi to all, I'd like to calculate hours and minutes having the following situation where A and B are query, B and C are the data stored in a table: ->Time A B | | C D | | A = '2010-01-20 09:00:00' B =

[sqlite] Use of strftime in a CREATE INDEX sintax.

2010-06-25 Thread Danilo Cicerone
Hi to all, I'm trying to create an index as follow: CREATE TABLE FattureCli ( fat_id INTEGER PRIMARY KEY, fat_rif_sogid INTEGER DEFAULT NULL, fat_rif_mpaid INTEGER DEFAULT NULL, fat_numfat INTEGER NOT NULL, -- It would be unique by year; fat_datfat CHAR(10) NOT NULL, -- -MM-DD;

[sqlite] Index creation using 'strftime'.

2010-06-25 Thread Danilo Cicerone
Hi to all, I'm trying to create an index as follow: CREATE TABLE FattureCli ( fat_id INTEGER PRIMARY KEY, fat_rif_sogid INTEGER DEFAULT NULL, fat_rif_mpaid INTEGER DEFAULT NULL, fat_numfat INTEGER NOT NULL, -- It would be unique by year; fat_datfat CHAR(10) NOT NULL, -- -MM-DD;

[sqlite] Index creation using 'strftime'.

2010-06-25 Thread Danilo Cicerone
Hi to all, I'm trying to create an index as follow: CREATE TABLE FattureCli ( fat_id INTEGER PRIMARY KEY, fat_rif_sogid INTEGER DEFAULT NULL, fat_rif_mpaid INTEGER DEFAULT NULL, fat_numfat INTEGER NOT NULL, -- It would be unique by year; fat_datfat CHAR(10) NOT NULL, -- -MM-DD;