JSON in SQL Server

preview_player
Показать описание
Data is received in many different formats including text files, comma separated value files, excel spreadsheets, XML files and JSON files. It is crucial for anyone in the data analytics arena to be able to receive and output data in these various formats.

This video introduces the JSON format as it relates to SQL Server and shows an example of parsing the JSON into columns in the database. SQL Server has extensive facilities to consume and produce JSON.
Рекомендации по теме
Комментарии
Автор

Hi, I have a difficult task and can't decide where to ask.

I have some data in a MySQL database. I save a relay state that controls my heater each time the the temperature goes above or below a set point.
In the 'relay_state' table I have alternating rows of state 0 and 1 at different times. The table has a timestamp with default current_timestamp() on insert.
I know it will be difficult to calculate the times in between 1 and 0 states (or 0 and 1), so I know how much time the heater was ON or OFF.
I can try this in php but I have no clue how to calculate times...

Is there any way to calculate this from a SQL query? You are the Ninja and hopefully you can help me out with this one, or point me in the right direction...

btw, thank you or the knowledge you share with us.

JLaurel