3

I have a table which consists two columns amount and description. Now i need something like Select description from tab where sum(amount) > 5000 Which is not possible i guess. Is there any custom method to get this done ?

1 Answer 1

8

Try something like:

select description, sum(amount)
from tab
group by description
having sum(amount) > 5000
;
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks a lot. I need one more help. Accounts table contains acno and acid. Tab consists of acid. To group the above query based on acno i should write. Select acno,description,sum(amount) from tab,accounts where accounts.acid=tab.acid group by acno,description having sum(amount) > 5000. ???

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.