Skip to content
Advertisement

MySQL Workbench – SELECT is not valid at this position with this server version when using CASE WHEN statement [closed]

When implementing a basic CASE WHEN statement in MySQL Workbench, I am getting the following error “SELECT is not valid at this position for this server version. Expecting FOR, LOCK, TABLES, VALUES, WITH, ‘(‘”.

Here is my SQL query:

The OrderLineRate table consists of the following:

OrderID ProductID mode_dsc Weight minm_wgh_qty max_wgh_qty rate min_cost
1447133055 1678648 AIR 1.463 0 99.99 $0.05 $1.50

Software: MySQL Workbench (version 8.0.22.CE) to interact with a MySQL Server(version 8.0.22)

Advertisement

Answer

as cost is only appropriate after the end of the case.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement