sql - Group by query advise -


in sql server, having table product below

manf    prod    id  desc audi    a1  1   tyre tye 1 audi    a1  2   tyre type 2 audi    a1  3   tyre type 3 bmw     b1  4   tyre tye 1 bmw     b1  5   tyre type 2 bmw     b1  6   tyre type 3 toyota  t1  7   tyre type 1 

i want output group columns of manf , prod id should of values.. kindly advise query..

manf    prod    id audi    a1      1 bmw     b1      4 toyota  t1      7 

select manf, prod, min(id) id your_table group manf, prod 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -