Simon Slavin, on Thursday, November 14, 2019 05:18 PM, wrote...
>
> On 14 Nov 2019, at 10:06pm, Jose Isaias Cabrera, on
>
> > insert into t (a, b, c, d, e, idate) values
> >  (
> >    (SELECT a FROM t WHERE a = 'p001' ORDER BY idate desc limit 1),
> >    (SELECT b FROM t WHERE a = 'p001' ORDER BY idate desc limit 1),
> >    (SELECT c FROM t WHERE a = 'p001' ORDER BY idate desc limit 1),
> >    'y',
> >    (SELECT e FROM t WHERE a = 'p001' ORDER BY idate desc limit 1),
> >    '2019-02-12'
> >  );
> >
> > Is there a simpler way?  Thanks.
>
> No simpler way.  I suggest you duplicate the exiting row first, then UPDATE 
> the duplicate.

Yes, that was my first idea, but I am trying to do this with a bunch of 
INSERTs.  Thanks.

josé
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to