nene / prettier-plugin-sql-cst

Prettier SQL plugin that uses sql-parser-cst
https://nene.github.io/prettier-sql-playground/
GNU General Public License v3.0
132 stars 7 forks source link

[Feature request] Support `If` statement #8

Closed acbin closed 1 year ago

acbin commented 1 year ago

Hi, I use the plugin to format the following sql, but it shows Syntax Error: Unexpected "if"

# Write your MySQL query statement below

select employee_id,
if(employee_id %2=1 and left(name, 1) != 'M', salary, 0) bonus
from Employees
order by 1

图片

nene commented 1 year ago

There's a simple reason for this: MySQL is not supported.