Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Convert sql into informix..

$
0
0
Hi .....
I want to convert below sql stored procedure in to IBM Informix.Can you help me?
DELIMITER $$

DROP PROCEDURE IF EXISTS `pay_details` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `pay_details`( in start_date date,in end_date date)
begin
SELECT SUBSTRING(i002_number,-16,6) AS bin,
SUM(CASE WHEN orig_msg_type ='DBINT'
THEN i004_amt_trxn ELSE NULL END) AS Debit_Intrest,
SUM(CASE WHEN orig_msg_type ='PAYMT'
THEN i004_amt_trxn ELSE NULL END) AS Payments
FROM ctransactions
WHERE posteddate
BETWEEN start_date AND end_date GROUP BY bin;
end $$

DELIMITER ;

Thanx!

Viewing all articles
Browse latest Browse all 13329

Trending Articles