Hi any shortcut to combine duplicate rows to one row ?
Loading
Hi any shortcut to combine duplicate rows to one row ?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Tuhin PaulPosted Mar 3, 2023, 10:40 AM
Hello Meghana,
SQL: Use the "GROUP BY" statement to group together all rows with the same values in certain columns. Then use aggregate functions (such as SUM, AVG, or COUNT) to combine the values in other columns. For example, if you have a table with columns for "Name," "Age," and "Salary," and you want to combine all rows with the same name into one row, you could use the following SQL statement:
This will give you one row for each unique name, with the total age and total salary for all rows with that name.
Rajeev KumarPosted Mar 3, 2023, 9:50 AM
If you want to use a true DISTINCT only list out the column you want to receive distinct values of. If you have multiple columns then all those columns combined make up one distinct record.
Nitin SontakkePosted Oct 15, 2022, 6:32 AM
You will have to show some sample data and an expected output.
Typically, DISTINCT clause is used for the purpose, however, more details are required.