I have a time series in a SQLite Database and want to analyze it. The important part of the time series consists of a column with different but not unique string values. I want to do something like this: I don’t know how to get the countValue column. It should count all Values of the partition equal to …
SQL – Splitting string in multiple columns
I’d like to split the result from a query and display the values in separate columns. As an example I get the following result I want to split the values by ‘_’ and add them to separate columns. The query result should look something like this So far I can split the result. But for each valu…
How to calculate agregate values by condition?
here my base example Try smth like this, but nothing Could you help me? Answer UPDATE: for these, I have added a new column to allow ordering of the rows. As the OP referred to day_name as a number in code, I have assumed that they refer to days – and thus changed the ‘id’ column to ‘d…
Tired of typing SQL scripts like “SELECT TOP 10 * FROM” and other similar scripts. How to create an alias/shortcut in SSMS?
While doing a lot of research at my work I keep writing generic scripts like “SELECT TOP 10 * FROM” etc. Is there a way to for me to write something like a snippet so that when i type “ss” + Space/Tab it will insert the “SELECT TOP 10 * FROM” script? I have a number of scri…
Selecting the first row of group with additional group by columns
Say I have a table with the following results: How is it possible for me to select such that I only want distinct parent_ids with the min result of object0_behaviour? Expected output: parent_id | id |…
How to match a string after a token (using regex)?
I’m trying to extract mail addresses after a token ‘eaddr:’. So it would match the all occurrences in line entries, first consecutive string without spaces after that token: I tried: SELECT …
How to Split 2 Strings and insert in to 2 columns
I have 2 strings Declare @WhenDetails NVarchar(Max) =’07:00:0:0;1:00:1:0;6:00:1:0;10:00:1:0;’ Declare @Dosage NVarchar(Max) =’1.00;2.00;1.00;1.00′ I need to split these 2 string and insert into a …
How to Insert C# values to MySql?
I want to insert C# winform values to Mysql there are 3 columns name,id are TextBox text and gender is ComboBox value but there is error and error messsage said: MySql.Data.MySqlClient.MySqlException:…
Need an SQL query that will left join with another table, which will in turn return the latest values based on time, grouped into a single row
I need help with a SELECT SQL query that will left join with another table on id column, which will in turn return the latest values based on time, grouped into a single row? Basically, join the two tables in such a way that for each record in users table that exists in time_series table, return the latest va…
How to insert yes or no value into flag column based on regex query
I have a simple update that works great work analyzing a US based telephone number. It correctly inserts a Y in the phone_flag column based on the following query. UPDATE database.table SET phone_flag …