It is not possible to directly translate IANA time zone into an integer value in a SQL query as IANA time zones are represented by strings that do not correspond to a numeric system. However, you can use a lookup table that maps each IANA time zone to a unique integer value that can be used in your SQL query. Here is an example of a lookup table:
| IANA Time Zone | Integer Value | | :------------ | :------------ | | America/NewYork | 1 | | America/Chicago | 2 | | America/LosAngeles | 3 | | Europe/London | 4 | | Europe/Paris | 5 |
You can then join your main table with this lookup table on the IANA time zone column to get the corresponding integer value. For example:
SELECT t.*, l.integer_value
FROM my_table t
JOIN lookup_table l ON t.iana_time_zone = l.iana_time_zone
This will return all columns from the main table as well as the corresponding integer value from the lookup table for each IANA time zone.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2022-08-04 11:00:00 +0000
Seen: 9 times
Last updated: Jun 06 '21
What is the method for programmatic access to a time series?
What is the procedure for using pg_restore on Windows with Docker?
Can SqlDependency be used in a programming language other than .NET, such as node js?
How can multiple queries be merged into a single stored procedure in MySQL?
How can I deal with Expression.Error related to a column in Power Query?
How can you implement pagination in Oracle for the LISTAGG() function?
What is the process for implementing a FutureBuilder on an OnTap function in Flutter?