Having this COLORS table: How do I select the ID who have both COLOR RED & PINK? (Could be more than 2 colors) SELECT ID FROM COLORS WHERE COLOR IN (‘RED’) AND …
parse_timestamp vs format_timestamp bigquery
Could someone help me understand why these two queries are returning different results in bigquery? select FORMAT_TIMESTAMP(‘%F %H:%M:%E*S’, “2018-10-01 00:00:00” , ‘Europe/London’) returns …
SQL If statement – check if row count of subquery = 1
Any suggestions on how to do this? I have a complex if statement in a query that needs to check on various conditions for a given table. EG: IF EXISTS (SELECT Labeler FROM [xx].[dbo].[manuf] …
count sequence of particular value
I have a snowflake table like this: date_col | artc | locl | flag d1 | a1 | l1 | 0 d2 | a1 | l1 | 1 d3 | a1 | l1 | 1 d4 | a1 | l1 | 0 d5 | a1 | l1 | 0 d6 | …
Oracle SQL: select for weekday and converting column to date
I’m having a database with column (with datatype VARCHAR20) Created 2020-01-01T20:30:20.207Z 2020-01-04T23:10:00.242Z In the end I want to be able to filter for a certain weekday. My first step in …
Get three last movements of the per ID with LAG and GROUP BY in MySQL
I hope someone can help with this query, I have a requirement for a query that groups the id of the last date, but I want to have three columns with the 3 last movements. So I tried grouping by the id and used MAX(date), and used LAG to get the three last movements, but I’m getting an error from
How to send values to automatic sequential rows in an arrayformula on gsheets?
This would be much easier to solve on the 1* data sheet, but I am trying to have grouped data with a weekly quantity broken down into a daily # to make work easier further down the line. =query({…
LINQ double INNER JOIN on query translation when using selectMany
I have the following LINQ statement: Which uses the repository pattern. The search function is the one below: When I inspect the command that arrives in SQL Server I see that the query is translated in the following SQL: It works perfectly, but why there is an inner join duplicated: is a non-sense to me! If I…
Retrieve substring of a column name, then apply them to corresponding column data? SQL
I have a table with, let’s say, 13 columns. I need to take a part of the column name and apply it to the corresponding data in two columns. Example of what I start with: Class Result01 Result02 …
How to select data from day by day with special time?
I want to select data day by day. Condition: data will be cut the day from 10:00 pm to tomorrow 10 pm. For example: | REGTIME | T8 | T9 | T10 | | 2008-12-03 | 879 | 785| 542 | | 2008-12-04 | 556 | …