Skip to content

COPY INTO Snowflake Table with Extra Columns

I’ve got a table defined in Snowflake as: GLPCT and a file that looks like this: GLPCT.csv example: My copy into command looks like this: Problem Snowflake is throwing an error due to a column number mismatch. How can I get Snowflake to ignore the column that isn’t present in the file and not thro…

Mysql how to connect 2 subqueries

I have this mysql code: My code returns 2 different result set in mysql workbench. Is there any way I can connect those 2 result sets? Answer You can use double join clause among three tables : including distinct keyword.

T-SQL, looking to extract drug dose from column

I have a column of drug names with dose and I’m trying to extract the just the dose from the field. The difficulty comes in when I have combination drugs that have multiple doses. I can either extract the first numbers in the string, or all of them in one string with no way to separate them. Desired out…

Sum IIF in T-SQL

a need a help with T-SQL, I have an query to select current row and subtract with previous row. The goal is SUM results from IIF and group by date and shift. the query: DECLARE @timeStart time(4) = ‘…

Optimalization of select containing Union

I have and easy select: define account_id = 7 select * from A where ACCOUNT_ID = &account_id UNION select * from B where ACCOUNT_ID = &account_id; I would like to have account_id as input …

How to get ONLY NULL values from table MySQL

I have searched the forum profoundly but I did not see the answer to this specific case. Condiser this data model: I want to get only Building names where ALL of the rooms have no flowers (where …