Wednesday

sql:select one row on join

        

SELECT *
FROM AccountTransactions AS inv
INNER JOIN [Accounts basic] a2 ON inv.AccountId = a2.ID
JOIN ( SELECT *
FROM ( SELECT *,
ROW_NUMBER() OVER ( PARTITION BY AccountTransactionId ORDER BY ProcessDate ) AS RowId
FROM dbo.BillingTransactions
) Tmp
WHERE RowId = 1
) b ON inv.TransactionId = b.AccountTransactionId

more...

No comments:

imagemagic add text to image

rem different types of text annotations on existing images rem cyan yellow orange gold rem -gravity SouthWest rem draw text and anno...