Home » SQL & PL/SQL » SQL & PL/SQL » best denomination notes
best denomination notes [message #198648] Wed, 18 October 2006 02:14 Go to next message
Messages: 188
Registered: September 2006
Location: INDIA-karnataka
Senior Member
see i will put in a brief note what i need
if x person goes for shopping when he/she pays bill at cash counter his bill amount is 986.But the customer x has 1000 rupees in his hand and he pays the bill he should get back/balance amount 14 rupees back right
in this scenario the cash counter should give x person the least or less number of notes best probabilities
eg: in cash counter he has currency denomination 1000,500,100,50,20,10,9,7,5,2,1 etc rupee currency notes
where 10+2+2=14 or 2+2+2+2+2+2+2=14 logically this correct but actually cash counter should give customer 7+7=14 because this is the least/less currency denomination notes(count)
i should have a query which will fetch least/less number(count) of currency notes
note: cash counter should give minimum number of currency notes
i think we should use function/dynamic query array algorithm
in my database i have different denomination for 14 rupees best possibilities is 7+7=14 not 10+2+2=14 or 2+2+2+2+2+2+2=14
because i get 3 or 7 currency notes (count) but 7+7=14 is and 9+5=14 (this best answer)correct because it returns 2 currency notes(count)

thanks in advance all of u
Re: best denomination notes [message #198652 is a reply to message #198648] Wed, 18 October 2006 02:27 Go to previous messageGo to next message
Messages: 3727
Registered: October 2005
Location: Melbourne, Australia
Senior Member
Search the forum. This has been answered in the last few days.
Re: best denomination notes [message #198655 is a reply to message #198652] Wed, 18 October 2006 02:31 Go to previous message
Messages: 7062
Registered: December 2001
Senior Member
Closed. Continue in your original thread.


Previous Topic: group by for null column
Next Topic: best possibilities
Goto Forum:

Current Time: Thu Jul 27 19:58:45 CDT 2017

Total time taken to generate the page: 0.24194 seconds