SQLite Forum

Thoughts on why this is not working?
Login
Greetings!

This command brings,

`sqlite> select ProjID, Methodology,InsertDate from Project_List where ProjID='PR0000014752' ORDER BY InsertDate;
PR0000014752||2018-07-30_05-43-20
PR0000014752||2018-08-01_04-41-32
[clip]
PR0000014752||2020-03-06_06-51-32
PR0000014752||2020-03-09_08-51-14
PR0000014752||2020-03-10_06-56-06
PR0000014752|Waterfall|2020-03-13_06-29-19
PR0000014752|Waterfall|2020-03-18_12-06-38
PR0000014752|Waterfall|2020-03-19_08-14-33
sqlite>
`
Then, this command, should bring an entry,
`
sqlite> SELECT ProjID,
   ...>    Updated_By,
   ...>    InsertDate,
   ...>    var,
   ...>    oldv,
   ...>    newv
   ...> FROM
   ...> (
   ...>  SELECT ProjID,
   ...>    Updated_By,
   ...>    InsertDate,
   ...>    'Methodology' as var,
   ...>    (
   ...>   SELECT Methodology FROM Project_List WHERE
   ...>   ProjID = o.ProjID
   ...>   AND InsertDate < o.InsertDate
   ...>   ORDER BY InsertDate DESC
   ...>   LIMIT 1
   ...> ) AS oldv,
   ...>    Methodology as newv
   ...>    FROM Project_List as o
   ...> )
   ...> WHERE oldv <> newv
   ...> AND ProjID = 'PR0000014752'
   ...> ORDER BY InsertDate ASC;
sqlite>
`
But it does not. Thoughts? Complaints? Jokes? :-)  Thanks.

josé