[OT] SQL question

Peter Haworth pete at lcsql.com
Mon Nov 11 17:06:48 CET 2013


sqlite has a CASE statement to conditionally assign values which would
handle this. Maybe postgres has it too?

Pete
lcSQL Software
On Nov 11, 2013 6:26 AM, "Malte Brill" <revolution at derbrill.de> wrote:

> Hi all,
>
> thanks for giving some thought. After more lost hair, this appears to work:
>
> INSERT INTO test2 (id,UUID,nummer) VALUES (3,1,(SELECT MAX(value) FROM
> (SELECT erste_nummer AS VALUE FROM test1 WHERE test1.UUID='1' UNION SELECT
> max(nummer) AS VALUE FROM test2 where test2.UUID='1') AS t1)+1)
>
> The Problem is, that postGreSQL appears to be locking tables only during
> the transaction and automagically releases the lock, which is not ideal in
> my situation.
>
> All the best,
>
> Malte
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


More information about the use-livecode mailing list