Skip to content

Tag: sql

Combine data of double rows as output

I have an example table with Ids and Names, I would like to get a new table with unique Ids and the names of one column combined (grouped by ID). My data looks like this (SQL Server 2017 & 2019 – SSMS): My goal is to get the following output with a qry: Does anybody has a tip/suggestion how to

sql deleting duplicate row

I have a table in SQL i want only one owner_id i don’t want 100 multiple times, but i want amount of all owner_id 100 i,e that amount should be added(i,e. 1000+3000+12000) if i delete duplicate Owner_id row. how to do it And one more issue that owner_id from another table, how to get Owner name from ano…

SQL SELECT from based on truth table

How can I select the columns to be returned by a lookup truth table? my data: | nam | X | Y | | Bob | 2 | 5 | | Jan | 1 | 6 | the lookup table | prop| SHOW | | nam | true | | X | false| | Y | …

SQL query to get rows contains value of another query

I have 2 tables transaction and query. Transaction table have unique tid and the query table has tid_(subtransactionid). I want to get the list of all subtransactions by using tid. I tried this Answer You can join the tables and use the operator LIKE in the ON clause: If your database does not support the fun…