Subject | select column if it exists |
---|---|
Author | Hamish Moffatt |
Post date | 2017-10-08T23:45:33Z |
Is there a way to include a column in a SELECT but substitute a value if
it doesn't? I need my code to work with different versions of my db schema.
eg I want to SELECT A, B, C, ... but C might not exist.
SELECT * would work of course, except it will fetch a bunch of columns I
don't need.
thanks
Hamish
it doesn't? I need my code to work with different versions of my db schema.
eg I want to SELECT A, B, C, ... but C might not exist.
SELECT * would work of course, except it will fetch a bunch of columns I
don't need.
thanks
Hamish