I created an sql table on visual studio for visual basic, where i can put dynamic data every time i click on a button. I get the table results from textboxes and one datagridview with values(quantity,price,discount). I use the "command insert values into" inside a for loop to be able to get all the datagridview results. The problem is that the table has rows with duplicate values. I want to remove the duplicate values and keep only the values from datagridview e.g I have a table with the following format:
Sql-server – SQL how to remove duplicate results from same table
sql servervbavisual studio
Related Question
- Sql-server – Best way to increase no of partition in SQL Server Table
- Sql-server – Inline edit SQL Server database rows from Visual Studio
- Sql-server – Script component source won’t load when click “Edit Script…”
- Sql-server – Dynamic SQL UNPIVOT and putting results into existing table
- Sql-server – Insert into Table ignoring duplicate values
- Sql-server – Select from multiple rows without duplicate values, with all random data
Best Answer
Following code should work, tested in Memory table: