Skip to content

how to group the data by some interval datetimes?

there are many devices and while using it will upload data every some seconds or minutes. I want to get the sections of date-time that the device is in use can it be true that group the data by an interval? let us consider interval = 1 minutes then group the data which the minus of the two date-time is

MySQL table update after multi field check

Hi I have two table one like this one: table1 and one like this: table2 I would like to update all the fields on the table2 column “newID” based on this rules: if (table2.ID = table1.ID_actual or table2.ID=table1.ID_old) then table2.newID = table1.newID How can I resolve this problem ? Answer You …

MySQL Trigger Nested Group_Concat Duplicates

I have a trigger to conditionally GROUP_CONCAT a few columns. I can remove duplicates from within a single column, but I’m struggling to remove duplicates between two or more columns. Current trigger (two column example): Fiddle: https://dbfiddle.uk/?rdbms=mysql_8.0&fiddle=46a6bb915fa7e2e9106b073677eee6cd…

Output array type column

I have a table like so – How do I output this result – Answer For an array, you would use array_agg(): If you want the value as a comma-sseparated string: