How can we use “Decode” functionality in SQLite?

2019-08-13 03:04发布

问题:

I would like to use "Decode" functionality in SQLite select statement.

From what I have read, it looks like there is no such function in SQLite.

What could be a workaround so that we use something similar to "Decode" in SQLite?

回答1:

There is no decode in Sqlite. Use "case statement instead" it's standard SQL an runs on any DB - which is better anyway.