I want to do a DISTINCT but only apply in a column because I consult two things, an ID and an image and I just want you to show me an image of that product.
I try to keep it that way.
| producto | imagen |
|----------|----------------|
| 1111 | 0x15A8SA9A.... |
| 1112 | 0x15A8SA9A.... |
| 1113 | 0x15A8SA9A.... |
I have my table like this
Id -> int
producto -> int (relacionado con la tabla producto)
imagen -> image
Try this way
select producto, imagen
from imagenes
where producto in (select producto from imagenes group by producto)
What should I do? How do I make a DISTINCT only in the product column?
I'm using SQL SERVER 2008.
Thank you in advance for reading