如何在MySQL中使用选择大小写

问题描述 投票:0回答:2

以下是MSSQL语法,如何将其转换为mysql

    SELECT          
    _nextBillingDate = UB.NextBillingDate,
    _billingFrequency = (CASE IFNULL(UB.BillingFrequency,0) WHEN 0 THEN
     _defaultBillingFrequency ELSE UB.BillingFrequency END),
    _isCompletelyCreditBilled = (CASE WHEN PO.ChargeAmount > 0 THEN 0 ELSE 1 END),
    _ownerId = PO.OwnerId   
    FROM PaymentOrder PO
    INNER JOIN UserBillingInfo UB ON PO.OwnerId = UB.OwnerId
    WHERE PO.Id = _paymentOrderId
mysql
2个回答
2
投票
-- DECLARE variables at the top of your procedure SELECT UB.NextBillingDate, CASE IFNULL(UB.BillingFrequency,0) WHEN 0 THEN _defaultBillingFrequency ELSE UB.BillingFrequency END, CASE WHEN PO.ChargeAmount > 0 THEN 0 ELSE 1 END, PO.OwnerId INTO _nextBillingDate, _billingFrequency, _isCompletelyCreditBilled, _ownerId FROM PaymentOrder PO INNER JOIN UserBillingInfo UB ON PO.OwnerId = UB.OwnerId WHERE PO.Id = _paymentOrderId

0
投票
创建表newtable SELECT * FROM oldtable
最新问题
© www.soinside.com 2019 - 2024. All rights reserved.