How can we build a query in postgresql to display column value with time datatype as null when extracting it from other column has either 0 or null

I am in a fix how can I do this: I Have view A and B. View A has column mark_time (int datatype) and View B has start_time ( Time data type) in postgresql. In the view B I am pulling value from View A for column start_time. The logic should be if mark_time has 0 or Null value the it should show as NUll in start_time in View B else it should take the mark_time value passed through to_timestamp function .

Thanks



Read more here: https://stackoverflow.com/questions/67018478/how-can-we-build-a-query-in-postgresql-to-display-column-value-with-time-datatyp

Content Attribution

This content was originally published by gauri at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: