Swaraj Chhatre
Swaraj Chhatre

Reputation: 667

Select single row from database table with one field different and all other being same

I have a database table with 8 fields say Table(a,b,c,d,e,f,g,h).For some rows one of the field is different(say 4 different a values) while all other field values(b-h) in the schema are same.I have to make a table selecting just one rows from such rows with different a's but same b-h.That is I can select any one of the different a's and keep b-h same which they are and display it in table as 1 single row instead of 4.

Upvotes: 0

Views: 302

Answers (1)

Anon
Anon

Reputation: 10908

SELECT MIN(a) a,b,c,d,e,f,g,h
FROM mytable
GROUP BY b,c,d,e,f,g,h

Upvotes: 1

Related Questions