SQLite Forum

Thoughts on why this is not working?
Login
Never mind.  Apologies.  For those of you playing at home, I had to use coalesce to bring non-null value.  So, this now brings something,

`sqlite> SELECT ProjID,
   ...>    Updated_By,
   ...>    InsertDate,
   ...>    var,
   ...>    oldv,
   ...>    newv
   ...> FROM
   ...> (
   ...>  SELECT ProjID,
   ...>    Updated_By,
   ...>    InsertDate,
   ...>    'Methodology' as var,
   ...>    (
   ...>   SELECT coalesce(Methodology,'null') FROM Project_List WHERE
   ...>   ProjID = o.ProjID
   ...>   AND InsertDate < o.InsertDate
   ...>   ORDER BY InsertDate DESC
   ...>   LIMIT 1
   ...> ) AS oldv,
   ...>    coalesce(Methodology,'null') as newv
   ...>    FROM Project_List as o
   ...> )
   ...> WHERE oldv <> newv
   ...> AND ProjID = 'PR0000014752'
   ...> ORDER BY InsertDate ASC;
PR0000014752|Guzman Alcanfor, Pedro|2020-03-13_06-29-19|Methodology|null|Waterfall
sqlite>
`

thanks for your good thoughts.

josé