I need help!

haggy's profile image haggy posted 5 years ago in General Permalink

Hello All, I need help please. How do i filter the summation of a column given a certain condition. For example i want to select everything from a table until the summation of numbers on a specific column is equal to or grater than 2000. find attached a sample screen grab. Then intended column in there is the amount column.

Thanking you in advance.

1 attachment(s):
  • sql
haggy's profile image haggy posted 5 years ago Permalink

I've tried the below code to no avail:

while sum(mytable.amount) >= 2000 SELECT * FROM mytablel END while ;

haggy's profile image haggy posted 5 years ago Permalink

while sum(mytable.amount) <= 2000 Do SELECT * FROM mytable END while;

haggy's profile image haggy posted 5 years ago Permalink

I've tried the below code to no avail:

while sum(mytable.amount) >= 2000 Do SELECT * FROM mytablel END while ;

crudolf's profile image crudolf posted 5 years ago Permalink

Your solution does not like SQL?

However i think you can try with:

SELECT * FROM mytablel WHERE amount > 2000

Please login to leave a reply, or register at first.