in buy table . when customer buy same book 1 row add to table . so when see buy list in buy page its like this :
buy1 price1 downloadlink1
buy1 price1 downloadlink1
buy1 price1 downloadlink1
buy2 price2 downloadlink2
buy2 price2 downloadlink2
buy2 price2 downloadlink2
but i want in same row price and downloadlink delete and only first row show this value
like this :
buy1 price1 downloadlink1
buy1
buy1
buy2 price2 downloadlink2
buy2
buy2
how can i use sql query???
well if it would be MS SQL server I could suggest using
row_number over()But in your situation I can suggest try this (I suppose you have some id in your table)
SQL FIDDLE