Hello Arne, Thanks a lot, but I did not gave you the whole picture, as usually.Sorry for that. It may look like this 1, x, 2019-08-26 12:44 2, x, 2019-08-26 12:45 3, x, 2019-08-26 12:46 4, y, 2019-08-26 12:47 5, z, 2019-08-26 12:48
I need to select to get a result like this: x, 2019-08-26 y, 2019-08-26 z, 2019-08-26
2019-08-26 16:00 x 2019-08-26 16:01 x 2019-08-26 16:03 x 2019-08-26 16:06 x 2019-08-26 15:55 y 2019-08-26 15:54 y 2019-08-26 15:58 y 2019-08-26 15:58 y
Could this be since there probably is some millisec that makes each row unique?
Hmm... my Oracle seems not to like the DATE()-call.
So would you say that this is wrong (it gives my duplicate rows like above):
SELECT DISTINCT(tidpunkt), meddelande FROM my_table; WHERE tidpunkt between sysdate-10 AND sysdate AND meddelande like '%MyMeddelande%' ORDER BY meddelande;
Sorry but missed to remove a semicolon.Sorry for spamming! So would you say that this is wrong (it gives my duplicate rows like above): SELECT DISTINCT(tidpunkt), meddelande FROM my_table WHERE tidpunkt between sysdate-10 AND sysdate AND meddelande like '%MyMeddelande%' ORDER BY tidpunkt;
Btw I do not I think it is possible to just get it per day if there are several rows spread among a day at different times.
SELECT DISTINCT TO_CHAR( tidpunkt, 'YYYY-MM-DD'), meddelande FROM my_table WHERE tidpunkt between sysdate-10 AND sysdate AND meddelande like '%MyMeddelande%' ORDER BY TO_CHAR( tidpunkt, 'YYYY-MM-DD');
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.