How to select one image in a product/image join table

I have two tables ( property and property_images ). property_Images contains images with foreign key linking to property tables.
i would like to fetch one image per property.
please how do i achieve that.

Let’s say I have these tables:
property_image table.

property table

Which image? You can use GROUP BY or DISTINCT

https://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.