Στις 11/4/23 23:06, ο/η Adrian Klaver έγραψε:
> On 4/11/23 12:47, Federico wrote:
>> Hello list,
>>
> https://www.sqlite.org/lang_returning.html#limitations_and_caveats
>>
>> Searching the archive seems that a using the INSERT SELECT ORDER BY
>> form should be a better solution,
>> so the above insert should be rewritten as
>>
>> INSERT INTO t(data)
>> SELECT data FROM (VALUES ('a', 1), ('b', 2), ('c', 3)) as vv(data,
>> num) ORDER BY num
>> RETURNING id
>
> Or
>
> with i as (INSERT INTO t(data) VALUES ('a', 1), ('b', 2), ('c', 3)
> returning id)
> select i.id from i order by id;
+1 for this version!
>
>> Sorry for the long email,
>> Thanks
>>
>> Federico
>>
>>
>
--
Achilleas Mantzios
IT DEV - HEAD
IT DEPT
Dynacom Tankers Mgmt