Hi, please could someone help me with this. I can't seems to get my mind around the SQL statement I need to get what I want. Below is my table.
| product_id | product_name | product_thumb_image |
------------------------------------------------------
| 1 | ProductA | images/img_A.jpg |
| 2 | ProductB | images/img_B.jpg |
| 3 | ProductB | images/img_B2.jpg |
| 4 | ProductC | images/img_C.jpg |
| 5 | ProductD | images/img_D.jpg |
Notice there are 2 ProductBs.
I would like a SQL statement to select the "product_thumb_image" such that it returns a row for each product name, but where a product has a 2nd image then a second column is also return.
e.g.
| mages/img_A.jpg | NULL/0/'' |
| mages/img_B.jpg | images/img_B2.jpg |
| mages/img_C.jpg | NULL/0/'' |
| mages/img_D.jpg | NULL/0/'' |
Any help will be appreciated, thanks.