You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
db-schema/db_scripts/diff/15086.up

10 lines
387 B

use billing;
insert into contract_balances (
contract_id, cash_balance, cash_balance_interval,
free_time_balance, free_time_balance_interval,
start, end)
select * from (
select '1' as c1, '0' as c2, '0' as c3, '0' as c4, '0' as c5, '2014-01-01 00:00:00', '2014-01-31 23:59:59'
) as tmp where not exists (select id from contract_balances where contract_id = 1) limit 1;