Is it possible ?
INSERT INTO tblPeople (id, group, company) VALUES (1, 'myGroup', IF($company = '') BEGIN 'no company' ELSE 'myCompany' END)
I would like test a value, an if the variable $company is empty, I would like write no company.
Try this:
INSERT INTO tblPeople (id, group, company)
select 1, 'myGroup',
case
when @company is null or @company = '' then 'no company'
else 'myCompany'
END as company
/*from tab --<-- optional*/
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