Re: [sqlite] "Cheating" at making common tables

2018-08-04 Thread Simon Slavin
On 5 Aug 2018, at 2:40am, Stephen Chrzanowski wrote: > I'm making a small database for a game, and a bunch of the tables follow > the same kind of naming convention due to normalization, like > > {Name_Of_Information}s > {Name_Of_Information}ID as Integer > {Name_Of_Information}Name as Char >

Re: [sqlite] "Cheating" at making common tables

2018-08-04 Thread Kees Nuyt
On Sat, 4 Aug 2018 21:40:53 -0400, Stephen Chrzanowski wrote: > I'm making a small database for a game, and a bunch of the tables follow > the same kind of naming convention due to normalization, like > > {Name_Of_Information}s > {Name_Of_Information}ID as Integer > {Name_Of_Information}Name

Re: [sqlite] "Cheating" at making common tables

2018-08-04 Thread Keith Medcalf
On Saturday, 4 August, 2018 20:01, Stephen Chrzanowski wrote: >I was right. I got the tables done before a response. But still >would like to know if there's a SQLite method of doing so. Of course there is. >My method was to use a templating application that I wrote at work. I >give it

Re: [sqlite] "Cheating" at making common tables

2018-08-04 Thread J Decker
I did this sort of thing in Xperdex ( https://sourceforge.net/projects/xperdex/ ) which is a C# thing, and enabled easy creation of DataTables similarly auto creating ID and Name by stripping pluralization from the name. Was working on a similar thing for JS; but keep getting distracted making it

Re: [sqlite] "Cheating" at making common tables

2018-08-04 Thread Stephen Chrzanowski
I was right. I got the tables done before a response. But still would like to know if there's a SQLite method of doing so. My method was to use a templating application that I wrote at work. I give it this variable declaration: Name=Resource I then give it this text: CREATE TABLE [%(Name)s](

[sqlite] "Cheating" at making common tables

2018-08-04 Thread Stephen Chrzanowski
I'm making a small database for a game, and a bunch of the tables follow the same kind of naming convention due to normalization, like {Name_Of_Information}s {Name_Of_Information}ID as Integer {Name_Of_Information}Name as Char So for example: Resources ResourceID as Integer ResourceName

Re: [sqlite] Using CTE with date comparison

2018-08-04 Thread Keith Medcalf
WITH RECURSIVE dates(dateD) AS (VALUES(:StartDate) UNION ALL SELECT date(dateD, '+1 year') FROM dates WHERE date(dateD, '+1 year') <= :EndDate ) SELECT max(dateD), count(*) FROM dates; --- The fact that

Re: [sqlite] Using CTE with date comparison

2018-08-04 Thread Csányi Pál
2018-08-04 14:07 GMT+02:00 Csányi Pál : > 2018-08-03 13:09 GMT+02:00 R Smith : > >> Do you want a recursive query that will add all years between 3 October and >> some other date, but NOT the first year and NOT the last year? > > I want a recursive query that gives years to the start date until it

Re: [sqlite] Using CTE with date comparison

2018-08-04 Thread Csányi Pál
2018-08-03 13:09 GMT+02:00 R Smith : > Do you want a recursive query that will add all years between 3 October and > some other date, but NOT the first year and NOT the last year? I want a recursive query that gives years to the start date until it reaches the end date or if it exceeds the end