veritabanımda
|1. sütun | 2. sütun ---------------------------- | 12 | 5 | 12 | 9 | 14 | 5 | 14 | 10 | 15 | 5 | 15 | 11 | 21 | 12 | 21 | 13
şeklinde 2 sütun var.
1. sütunda her numara 2 kere tekrar ediliyor. 2. sütunda ise bu tekrarlardan 1 numara hep aynı.
$sql = "SELECT product.product_id, product.model, product.quantity, product.image, product.price AS fiyat, product_special.*, product_description.* FROM product LEFT JOIN product_special ON product.product_id = product_special.product_id LEFT JOIN product_description ON product.product_id = product_description.product_id LEFT JOIN product_to_category ON product.product_id = product_to_category.product_id WHERE product.quantity='1' ORDER BY product.model ASC LIMIT 100";şeklinde bir sorgum var. bu yukarıda bahsettiğim tablo dışında hiçbir tabloda böyle aynı id'ye sahip olup da 2 kayıt girişi olan bir tablom yok.
benim derdim bu sorguya öyle birşey ekleyeyim ki 2. sütunda tekrar eden değer hiç gelmesin. bu sayede sanki bu tablo da tek satır olarak gelsin.
umarım anlatabilmişimdir