2
I’ll try to get to the point.
I got the following SELECT
:
SELECT * FROM "Inverter" WHERE "InstallationUUID" = '0D013C023900-15-0B4B00' AND "CreatedTime_Key" > 20170718000000 AND "CreatedTime_Key" <= 20170718001500 AND "DataQuality" = 1 ORDER BY "CreatedTime_Key" ASC
I was wondering if you had any commands WHERE
ignore the last 2 digits of the value I am comparing to it. Example:
"CreatedTime_Key" > 201707180000(00) AND "CreatedTime_Key" <= 201707180015(00)
Numbers between '()' are the ones I want to ignore.
Examples for a better understanding of what I want to do:
Table example:
| ID | CreatedTime_Key | Nome |
| 01 | 20170718000001 | CAIO |
| 02 | 20170718000501 | JOAO |
| 03 | 20170718000002 | MARIA |
| 04 | 20170718001000 | MARIO |
...
I want the SELECT
:
SELECT * FROM "Inverter" WHERE "InstallationUUID" = '0D013C023900-15-0B4B00' AND "CreatedTime_Key" > 20170718000000 AND "CreatedTime_Key" <= 20170718001500 AND "DataQuality" = 1 ORDER BY "CreatedTime_Key" ASC
Return to me:
| ID | CreatedTime_Key | Nome |
| 02 | 20170718000501 | JOAO |
| 04 | 20170718001000 | MARIO |
NOTE: I cannot change the values that go on
WHERE
. They need to be thus Datetime (20170818001500 = 2017/07/18 00:15:00), or it is necessary to ignore the seconds in theWHERE
.
Which one
SGBD
?– Sorack
@Sorack IBM DB2
– Caio Henrique Reblin