I am trying to Insert/update a string (JSON). While inserting/Updating the value I get data truncation error. I have tried making a JSON type column and passing an JSON_OBJECT() type but that fails …
MySQL Workbench “OLD” syntax changed?
I had a trigger set in MySQL workbench that used to accomplish what I wanted. Recently, my workplace updated MySQL workbench to version 6.3.10 across all computers and the triggers were dropped during …
Getting An Error When trying to Calculate two columns
When I run my query I am getting a Precision Error. It is coming from my function after * I tried changing the columns data type to an integer and to_number. it is a varchar. SELECT * , (tableb….
Oracle split repeating rows into columns when joining 2 tables
I have 2 tables like this: table_a id col2 1 A 1 B 2 A 2 B 3 B table_b id col1 1 X 2 Y 3 Z I want to join both the tables such that the resultant contains the repeating row …
Oracle SQL analytical query
SQL> select LAST_UPDATED_DATE, ODOMETER from demo; LAST_UPDA ODOMETER ——— ———- 05-OCT-18 47174.77 08-OCT-18 12-OCT-18 50246.37 15-OCT-18 19-OCT-18 53743.11 21-OCT-18 22-OCT-18 25-…
How to set the user rights by passing the database name as Input parameter in a stored procedure?
How to set the user rights by passing the database name as Input parameter in a stored procedure? Declare @username nvarchar(100) Declare @databasename nvarchar(100) set @username = ‘ABC’ CREATE …
Disable trigger in another db(Oracle)
Can I create a procedure that disables a trigger in another database? I mean, can I disable it with a database link? I need it for importing data into a data warehouse
Single Item Order – AdventureWorks
I am wondering if my answer works for this problem? The answer I was able to find on the internet seems similar but they join another table which seems ambiguous. Question: A “Single Item Order” is …
Convert/get varchar variable to YYYYMM
I have 4 CTE’s in this table and the third one contains a DATETIME converted to VARCHAR (with format based on the requirement) as startDate in DD/MM/YYYY format. The last cte does calculations based …
Select values with a more recent year and month when both are stored in different columns in SQL Server
The setup in both tables is that year and month are in two seperate columns as numbers. I am trying to select the values from one table that do not exists in the other table (so are more recent date wise). For example: Table1 has values from 2016 until today and Table2 only until end of 2018. So I want