|
Depending on what database you use, I am familiar with oracle, and give you the implementation of oracle sql. The implementation mainly uses the decode function
select ... decode (expense classification, A, ypid, zlid), decode (expense classification, A, ypname, zlname)
To explain: the decode function is a conditional statement in SQL. If "Expense Classification" = "A", then ypid, otherwise zlid. Others are similar. Hope that helps. If the database is not using oracle, you can find similar functions implemented by your database. |
|