Ads were blocked by your webbrowser.

This is not a problem, but keep in mind that developing HeidiSQL, user support and hosting takes time and money.

You may want to send a donation instead.

I need help!

haggy's profile image haggy posted 3 months 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 3 months 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 3 months ago Permalink

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



Ads were blocked by your webbrowser.

This is not a problem, but keep in mind that developing HeidiSQL, user support and hosting takes time and money.

You may want to send a donation instead.
haggy's profile image haggy posted 3 months 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 3 months 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.