image hereMySQL Workbench tells me that can't find WITH valid for this server version although I already have the latest SERVER version installed - 5.7.27. Workbench is 8.0.17
WITH all_customers_and_reps AS
(
SELECT customer.customerNumber, customer.salesRepEmployeeNumber
FROM customer
WHERE salesRepEmployeeNumber = 1166
)
SELECT * FROM all_customers_and reps;
The Common table expressions available starting from mysql versions 8.0 You could sobstitute with a dinamic/temporary table eg:
SELECT * FROM (
SELECT customer.customerNumber, customer.salesRepEmployeeNumber
FROM customer
WHERE salesRepEmployeeNumber = 1166
) all_customers_and reps;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With