Soldato
Managed to solve my other issue so thanks for that. Anyway I have come across the following SQL, which I don't quite understand
The first select seems to be a substitute for the VALUES(x, x, x,x) so I understand that. I don't understand the where not exists select however, what in blue blazes does select 1 do in this case?
Code:
INSERT INTO test
(trans_id,voucher_id,trans_date,ledger_code_1,company_code,trans_type, Trans_amount)
SELECT 1, 1,'2012/04/01','2001', '8523a95b-5425-46be-89ed-ebd592846845', 'Payment', -30
from test
where not exists(
select 1
from test
where trans_id = 1
and ledger_code_1 = '2001'
)
The first select seems to be a substitute for the VALUES(x, x, x,x) so I understand that. I don't understand the where not exists select however, what in blue blazes does select 1 do in this case?