I have a table that may have the same item but with different sizes, I would like to count those items with more than one size (e.g. marvel shirt with S, M sizes will count as “1”), but still be able …
Tag: sql
I’m getting ‘Subquery returned more than 1 value’, without a subquery on my SELECT
I have a view in which I don’t have access into modify it, and I have to make a SELECT query that brings me the rows in witch a column is empty (empty, not null) In this view I have: Oid| Name | …
SSIS Looping with Return Value from Stored Procedure
I am trying to create a SSIS Package that loops based on the return value of a stored procedure run in the loop. I keep getting a super NOT helpful error of: “Error: 0xC002F210 at Load Order, …
How to use conditional aggregation on columns which have multiple values in SQL
I need to generate an output to show different role(from table2) as separate columns for an id(from table 1), but the role is not mandatory to be present in the table 2 and sometimes there can be …
In SQL, how to prevent duplicate values for a user in a table, not for a whole table?
I would like to create a table with T-SQL. User is a foreign key from a users table. One user can’t have two same phone numbers in ‘phone1’ and ‘phone2’ fields. However, it is allowed that two users …
Data truncation: ” While Inserting or Updating Value
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-…