```
CREATE VIEW mainT 
AS SELECT transactionId AS accountId, glbalance AS debit 
IF(totalDebit > totalCredit), glbalance as Credit IF(totalCredit > totalDebit) 
FROM `trialbalanceView`

```

Is it possible to generate this kind of query in SQL?. Please any help, 'll be appreciated.