SELECT  'L', Ledger_ID as 'Ledger Id', Ledger_Name as 'Ledger Name', (SELECT Group_Name FROM account_groups WHERE Group_Id = LED.Group_Id) as 'Group'  FROM Ledger_Master LED order by Ledger_Name