Hi someone help in distinct command i have created 2 tables department and balance,
1. Department
dep_id, dep_code, dep_name
2 001 Bloom Room
3 002 Tahmeco Th
4 003 Kniting
2. Balance
dep_id, Date, Amount
2 01/Mar/2011 10000
3 02/Mar/2011 15000
4 20/Mar/2011 25000
3 22/Mar/2011 10000
2 26/Apr/2011 27000
4 28/Mar/2011 5000
3 29/Mar/2011 20000
Now i want to use the distinct command that gets all departments latests entered amount,
On latest date, date between 1st to 29th eg: >= 01/Mar/2011 AND <=29/Mar/2011
this is what i want from above table
2 26/Apr/2011 27000
4 28/Mar/2011 5000
3 29/Mar/2011 20000
Help me in this...