On Dec 20, 2011, at 9:52 PM, Nico Williams wrote:
> It'd be nice to have recursive queries (with tail-call optimization).
Yes for recursive with clauses!
http://gennick.com/with.html
> Then a lot of things get easier.
Like solving that damn sodoku puzzle:
Solving a Sudoku using Recursive
On Tue, Dec 20, 2011 at 5:21 AM, John Gillespie wrote:
> This would make a good entry for an Obfuscated SQL contest.
> Well done
Thanks, I guess :) It was a fun little SQL ditty to write, and only
took a few minutes. (Now I do I a search and see that factorial in
SQL is
This would make a good entry for an Obfuscated SQL contest.
Well done
John
On 19 December 2011 21:43, Nico Williams wrote:
> You can do conditionals via WHERE clauses, as others have pointed out.
> You can also use WHEN clauses on triggers.
>
> Think of it as IF .
You can do conditionals via WHERE clauses, as others have pointed out.
You can also use WHEN clauses on triggers.
Think of it as IF . And remember that the
WHERE clause can refer to all sorts of things, including parameters
from the application (something like WHERE @foo = 1).
You can do
One can essentially do a "if exists" on the column value they want to check,
and recurse it many times.
As an example, you could go
select * from table where exists (select colName from table where colName = 7);
If the nested select statement returns one or more rows, then it will return
a
On 13 Dec 2011, at 11:04pm, Grace Batumbya wrote:
> Since SQLite does not support stored procedures, what are some workarounds
> that are used to accomplish things like executing a statement based on a
> conditional.
Triggers and programming languages.
Simon.
On 12/13/2011 6:38 PM, BareFeetWare wrote:
If depends on what your statement 1 and statement 2 are. Let's say that they
are update statements, then your above example would look something like:
update tableX set column2 = 'match' where "column" = 'foo';
update tableX set column2 = 'no match'
On 14/12/2011, at 10:04 AM, Grace Batumbya wrote:
> Since SQLite does not support stored procedures, what are some workarounds
> that are used to accomplish things like executing a statement based on a
> conditional.
> For example.
>
> IF value OF column IN tableX == 'foo'
> DO statement 1
>
On 12/13/2011 6:04 PM, Grace Batumbya wrote:
Hey guys,
Since SQLite does not support stored procedures, what are some
workarounds that are used to accomplish things like executing a
statement based on a conditional.
For example.
IF value OF column IN tableX == 'foo'
DO statement 1
ELSE
Hey guys,
Since SQLite does not support stored procedures, what are some
workarounds that are used to accomplish things like executing a
statement based on a conditional.
For example.
IF value OF column IN tableX == 'foo'
DO statement 1
ELSE statement 2
Thanks,
--
*Grace Batumbya*
Research
10 matches
Mail list logo