I'm trying to join two tables and select certain columns to display in the output including a 'flag' if a certain transaction amount is greater than or equal to 100. The flag would return a 1 if it is, else null.

I thought I could achieve this using a CASE in my SELECT but it only returns one record every time since it returns the first record that meets this condition. How do I just create this 'FLAG' column during my join easily?

```
SELECT payment_id, amount, type, 
CASE
    WHEN amount >= 100 THEN 1
    ELSE NULL
END AS flag
FROM trans JOIN customers  ON (user_id = cust_id)
JOIN bank ON (trans.bank = bank.id)
WHERE (error is false)

```

I expect an output such as:

```
payment_id amount type  flag
1          81      3     NULL
2          104     2     1
3          150     2     1
4          234     1     1

```

However, I'm only getting the first record such as:

```
payment_id amount type  flag
2          104     2     1

```