Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Dates

$
0
0
I am working on my query to get a total cost for each client. I tried to calculate the rent and add discount 40% for each one but in order to give each one discount I need to imply a role saying that for each client to rented the video over 10 days, there will discount the 40% , less than that the total cost should appear without discount


SELECT CCLIENTNO, SUM(RENTV-0.2) TOTAL
FROM CLIENT C, RENT_AG R
WHERE C.CLIENT_NO = R.CLIENT_NO
GROUP BY CLIENTNO
HAVING SUM(RENTV - 0.2) ( HERE SHOULD BE SUBQUERY ASKS FOR THE START DATE OF THE RENT AND THE END DATE );

Any help please!!

Viewing all articles
Browse latest Browse all 13329

Trending Articles