Re: [sqlite] probably recursive?

2018-05-04 Thread E.Pasma
Cezary H. Noweta wrote: CREATE TABLE points AS WITH cte(x,y,n) AS (SELECT (random() % 10 + 10) % 10 + 1, (random() % 10 + 10) % 10 + 1, 1 UNION ALL SELECT (random() % 10 + 10) % 10 + 1, (random() % 10 + 10) % 10 + 1, n + 1 FROM cte WHERE n < 100) SELECT x, y FROM cte; and CREATE TABLE

Re: [sqlite] probably recursive?

2018-05-04 Thread Cezary H. Noweta
Hello, On 2018-05-04 20:02, Roman Fleysher wrote: For some reason, I did not receive email from Cezary, only comments on it. About 50% of e-mails from is marked as SPAM by my server for unknown reason. Independently on an author. But, most importantly, could you elaborate more on how it w

Re: [sqlite] probably recursive?

2018-05-04 Thread Roman Fleysher
: Friday, May 04, 2018 10:35 AM To: SQLite mailing list Subject: Re: [sqlite] probably recursive? Cezary H. Noweta wrote: >> >>> At the beginning I would like to agree with that the problem is >>> iterative rather then recursive one. However R. Smith wrote: > >>

Re: [sqlite] probably recursive?

2018-05-04 Thread E.Pasma
Cezary H. Noweta wrote: At the beginning I would like to agree with that the problem is iterative rather then recursive one. However R. Smith wrote: LOL, that might be the hackiest query I ever seen, but kudos mate, that's bloody marvellous! Cezary, thanks for the diverting solution

Re: [sqlite] probably recursive?

2018-05-04 Thread Cezary H. Noweta
Hello, On 2018-05-04 03:07, R Smith wrote: On 2018/05/04 1:54 AM, Cezary H. Noweta wrote: At the beginning I would like to agree with that the problem is iterative rather then recursive one. However LOL, that might be the hackiest query I ever seen, but kudos mate, that's bloody marvello

Re: [sqlite] probably recursive?

2018-05-03 Thread R Smith
On 2018/05/04 1:54 AM, Cezary H. Noweta wrote: Hello, At the beginning I would like to agree with that the problem is iterative rather then recursive one. However LOL, that might be the hackiest query I ever seen, but kudos mate, that's bloody marvellous! I corrected the table to not

Re: [sqlite] probably recursive?

2018-05-03 Thread Cezary H. Noweta
Hello, At the beginning I would like to agree with that the problem is iterative rather then recursive one. However, On 2018-05-01 14:15, R Smith wrote: That depends on what you mean by "Could this be achieved in SQLite?". There is no query (in any SQL engine) that can depend on a sub-query

Re: [sqlite] probably recursive?

2018-05-01 Thread Roman Fleysher
Subject: Re: [sqlite] probably recursive? Ah my bad, I misunderstood the initial condition. nX is a function of X. My statements were only true if nX=X. Well, sorry about the noise. > On 2 May 2018, at 8:20 am, Roman Fleysher > wrote: > > Dear Barry, > > The statement about

Re: [sqlite] probably recursive?

2018-05-01 Thread Barry Smith
were never on the list or were eliminated. > > Roman > > > From: sqlite-users [sqlite-users-boun...@mailinglists.sqlite.org] on behalf > of Barry Smith [smith.bar...@gmail.com] > Sent: Tuesday, May 01, 2018 6:12 PM > To: SQLite mailing list > Sub

Re: [sqlite] probably recursive?

2018-05-01 Thread Barry Smith
_ >> From: sqlite-users [sqlite-users-boun...@mailinglists.sqlite.org] on behalf >> of Barry Smith [smith.bar...@gmail.com] >> Sent: Tuesday, May 01, 2018 6:12 PM >> To: SQLite mailing list >> Subject: Re: [sqlite] probably recursive? >> >> Well tho

Re: [sqlite] probably recursive?

2018-05-01 Thread Abroży Nieprzełoży
e never on the list or were eliminated. > > Roman > > > From: sqlite-users [sqlite-users-boun...@mailinglists.sqlite.org] on behalf > of Barry Smith [smith.bar...@gmail.com] > Sent: Tuesday, May 01, 2018 6:12 PM > To: SQLite mailing list > Subjec

Re: [sqlite] probably recursive?

2018-05-01 Thread Roman Fleysher
From: sqlite-users [sqlite-users-boun...@mailinglists.sqlite.org] on behalf > of Barry Smith [smith.bar...@gmail.com] > Sent: Tuesday, May 01, 2018 5:23 PM > To: SQLite mailing list > Subject: Re: [sqlite] probably recursive? > > Is there a uniqueness constraint on your initia

Re: [sqlite] probably recursive?

2018-05-01 Thread Barry Smith
-boun...@mailinglists.sqlite.org] on behalf > of Barry Smith [smith.bar...@gmail.com] > Sent: Tuesday, May 01, 2018 5:23 PM > To: SQLite mailing list > Subject: Re: [sqlite] probably recursive? > > Is there a uniqueness constraint on your initial data? Can the same > coord

Re: [sqlite] probably recursive?

2018-05-01 Thread Roman Fleysher
Barry Smith [smith.bar...@gmail.com] Sent: Tuesday, May 01, 2018 5:23 PM To: SQLite mailing list Subject: Re: [sqlite] probably recursive? Is there a uniqueness constraint on your initial data? Can the same coordinate be listed multiple times? Is there a requirement that X > 0 and Y > 0? >

Re: [sqlite] probably recursive?

2018-05-01 Thread Barry Smith
Is there a uniqueness constraint on your initial data? Can the same coordinate be listed multiple times? Is there a requirement that X > 0 and Y > 0? > On 2 May 2018, at 3:35 am, Simon Slavin wrote: > >> On 1 May 2018, at 6:28pm, Simon Slavin wrote: >> >> I just realised that > > That was i

Re: [sqlite] probably recursive?

2018-05-01 Thread Simon Slavin
On 1 May 2018, at 6:28pm, Simon Slavin wrote: > I just realised that That was intended to be personal email. Apologies, everyone. Simon. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman

Re: [sqlite] probably recursive?

2018-05-01 Thread Simon Slavin
On 1 May 2018, at 1:45am, Roman Fleysher wrote: > If x=10 has less than nX dots, all dots with x=10 are deleted. Because of > deletion, y=3 which previously had more than nY dots no longer passes the > threshold and thus y=3 must be deleted too. This could cause deletion of some > other x, etc

Re: [sqlite] probably recursive?

2018-05-01 Thread Roman Fleysher
Agree. Thank you. Roman From: sqlite-users [sqlite-users-boun...@mailinglists.sqlite.org] on behalf of Simon Slavin [slav...@bigfraud.org] Sent: Tuesday, May 01, 2018 12:50 PM To: SQLite mailing list Subject: Re: [sqlite] probably recursive? On 1 May

Re: [sqlite] probably recursive?

2018-05-01 Thread Simon Slavin
On 1 May 2018, at 5:34pm, Roman Fleysher wrote: > With recursive route, I am thinking I need to build deleteList(x,y). Rather than actually delete rows, if you can, insert a new column in the table of all points. It starts with every row set to TRUE. When you decide a row doesn't count the v

Re: [sqlite] probably recursive?

2018-05-01 Thread Roman Fleysher
AM To: SQLite mailing list Subject: Re: [sqlite] probably recursive? My initial thought on this would be recursive on delete triggers. You're limited then to SQLITE_MAX_TRIGGER_DEPTH (defaults to 1,000) though, so really big cascades wouldn't fully complete. You can raise t

Re: [sqlite] probably recursive?

2018-05-01 Thread David Raymond
hen. Will have to think about the recursive CTE route later. -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of R Smith Sent: Tuesday, May 01, 2018 8:16 AM To: sqlite-users@mailinglists.sqlite.org Subject: Re: [sqlite] probably recursive

Re: [sqlite] probably recursive?

2018-05-01 Thread R Smith
That depends on what you mean by "Could this be achieved in SQLite?". There is no query (in any SQL engine) that can depend on a sub-query that is itself dependent on the outcome of the main query. This is what makes recursion beautiful, but then there is also no CTE (or other query in any SQL

Re: [sqlite] probably recursive?

2018-04-30 Thread Simon Slavin
On 1 May 2018, at 1:45am, Roman Fleysher wrote: > If x=10 has less than nX dots, all dots with x=10 are deleted. Because of > deletion, y=3 which previously had more than nY dots no longer passes the > threshold and thus y=3 must be deleted too. This could cause deletion of some > other x, etc

[sqlite] probably recursive?

2018-04-30 Thread Roman Fleysher
Dear SQLiters, I have trouble solving this problem, maybe it is impossible? I have a table with two columns x and y, both integers. Imagine they are coordinates on X-Y plane, dots. I need to find all x's that have more than nX dots, and all y's that have more than nY dots. Both conditions must