Dear All,
I have a query as below SELECT DISTINCT (productID),totalAmountAfter,transactionDate FROM tbltransaction WHERE transactionDate BETWEEN '2010-01-01' AND '2010-12-31' ORDER BY productID,transactionDate DESC .
My problem now I want is that for each product only pick one line that is the last line since I have ordered by the date. But even using distinct I still get a more than one data for each productID. Any solution for this?
newbie14 0 Posting Pro
drjohn 56 Posting Pro in Training
newbie14 0 Posting Pro
smantscheff 265 Veteran Poster
newbie14 0 Posting Pro
smantscheff 265 Veteran Poster
newbie14 0 Posting Pro
smantscheff 265 Veteran Poster
newbie14 0 Posting Pro
smantscheff 265 Veteran Poster
newbie14 0 Posting Pro
voidyman 0 Newbie Poster
newbie14 0 Posting Pro
voidyman 0 Newbie Poster
newbie14 0 Posting Pro
voidyman 0 Newbie Poster
newbie14 0 Posting Pro
smantscheff 265 Veteran Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.