阅读背景:

如何在select语句中使用mysql变量/如何在下一个select中使用'as'变量

来源:互联网 
select 
count(invoice.id) as count_invoice_id, // i want to simply use count_invoice_id instead of using count(discount_offer.id) again inside the if statement below
if(count(invoice.id) > 1 , 'true','false') // i want to used count_invoice_id here
from invoice as invoice
left join discount_offer as discount_offer 
on invoice.id = discount_offer.invoice_id;
select 
count(invoice.id) as count_invoice_id, 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: