Bucketing Values using Group By Not Working?

Bucketing Values using Group By Not Working?

I have a table that looks like this:

I have a table that looks like this:

Field A | Field B | Field C | Field D | Field E | Field F
100001  |  10.00  | 2.00   | -1.00. | 7.00   | "0-9.99
100002  |  8.00   | 1.00   | NULL   | 7.00   | "1-9.99"
100003  |  40.00  | 2.00.  | NULL   | 38.00  | "30.00-39.99"
100004  |  20.00  | 1.00.  | NULL   | 19.00  | "10 - 19.99"
100005  |  30.00  | 11.00  | NULL   | 19.00. | "10 - 19.99"

Field E is a sum of fields B, C, and D - I've got that working and here's my code

Now, I want to create a calculated field Field F which buckets the values in field E based on their value. For example, row one would be in 0-9.99 but I have no idea how to do this.

Ideally, I'd like to do this ALL in one query. And the particular syntax is PostgreSQL but this particular application doesn't play nice. Even SELECT * FROM Table1; throws an error. It's likely due to my relative inexperience with this syntax but maybe you guys could tell me how to fix this query. Here's what I tried so far

  SELECT "Field A,"Field B","Field C","Field D",
  (coalesce("FIELD B", 0) - coalesce("Field C", 0) + 
  coalesce("Field D", 0)) AS "Field E" 
  From "Table1";SELECT "Field E",CASE WHEN “Field D” >= 0 and 
  “FIELD D” <= 9.99 then “0-9.99”
     WHEN “FIELD D” >= 10 and “FIELD D” <= 19.99 then “10 to 19.99”
     WHEN “Field D” >= 20 and “Field D” <= 29.99 then “20 to 29.99”
     WHEN “Field D” >= 30 and “Field D” <= 39.99 then “30 to 39.99”
     WHEN “Field D” >= 40 and “Field D” <= 49.99 then “40 to 49.99”
     ELSE “$50+”
     END FROM “Orders”;

I literally just want a column where the buckets in Field F are chosen based on the value of field E (another calculated field). All my normal queries are not working in this particular application and I'm just trying to see if there is something stupid I'm missing. Thank you.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Learn PostgreSQL, PgAdmin, SQL and JDBC [Combo!] | Simpliv

Learn PostgreSQL, PgAdmin, SQL and JDBC [Combo!]

What is CRUD? | CRUD Operations with SQL and PostgreSQL

What is CRUD? | CRUD Operations with SQL and PostgreSQL - In this course we will be using SQL and PostgreSQL to perform CRUD operations

How to write SQL queries in PostgreSQL

In this tutorial, you will learn how to write simple SQL queries in PostgreSQL.