Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

How to return single row based on a column

$
0
0

Dear all,

I have the following table data

This table represent a customer basket where a customer for the same basket can have different PropertyId as hilighted above.

I would like to return the basket history for a customerId
I was initialy doing it with DISTINCT row as if the customer has many items in a single Basket Id I need to return only the single BasketID record, but this not working as expected because rows are different dur to different ProeprtyID.

Based on the records above, is tehre a way to return a single record basket ID based on customer ID ?

For exemple is customerID= the yellow value above I should have as a result

BasketID=f6444ff4-ff91-4867-a64c-b4c5b6b0c110
Revision Date =....

Is tehre a way to get a DISTINCT row like but based on a single column ?

thnaks fo sample

regards

serge


Your knowledge is enhanced by that of others.


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>