I’m stuck with an SQL query to get what I need. My input is this: COD SINOM A 123456 B 987654, 123456, 111111 C 123456 , 234501 D 9912345699 E 99123456, 789012 F 77123456 Both fields are …
show different columns from different table with inner join
Hi i have a lot of inner in a query but i can’t print column in different table, for example: where Table A id f ———– xxx gggg bbb kkkk Table B name code ———– ccc …
SQL, operation between paired rows
I have a table t1 a b 1 4 2 2 3 9 2 1 1 6 3 7 I need the output a result 1 4*6 2 2*1 3 9*7 I have been able to do it in a far from efficient way and would like a more …
Where condition with a specific hour and minute from a Timestamp SQL
I have to search for a particular hour and minute within a column of a table. For example: activitydate (timestamp without time zone) ——————— “2021-02-11 00:00:00” “2021-…
SQL Query doesn’t work in Azure SQL Data Warehouse (Synapse) why not?
I have an SQL query that works in an on-premise SQL Database, but when I try to execute it on an Azure SQL Data Warehouse, I get an error. Does anyone know another way of writing this SQL Query so …
Sum values from 2 joined tables even if id’s don’t match
I’m trying to take two tables, join them together based on their contract numbers and then get a sum of each customers contract amount between two years. However, some of these contracts were from an …
Conditional Data Validation In SSIS
I have a situation where table has two main columns DataFieldName & DataFieldValue along with some identifier such as OrderNumber. Now in DataFieldName there is value named as “OrderDate”…
How to convert SQL query to Linq in Entity Framework 6?
How can I convert this SQL query to a linq expression? Select distinct Clients.Id From Clients Join Orders On Clients.Id = Orders.ClientsId and Orders.Date < DATEADD(DD, -Clients.Term, CAST(…
Efficient Multiple Group-bys
I have the following table: Year Week Day_1 Day_2 Day_3 2020 1 Walk Jump Swim 2020 3 Walk Swim Walk 2020 1 Jump Walk Swim I want to group by YEAR, WEEK and Event (Walk, jump, Swim) and count the …
PL/SQL Dynamic SQL : Table name not valid
I’m currently learning PL/SQL. I need to create a PL/SQL block to create a backup of all my tables like this : myTable -> myTable_old. Here’s what I got right now : DECLARE Cursor c IS SELECT …