I have a table with several account fields like this:
MAIN_ACCT
GROUP_ACCT
SUB_ACCT
I often need to combine them like this:
SELECT MAIN_ACCT+'-'+GROUP_ACCT+'-'+SUB_ACCT
FROM ACCOUNT_TABLE
I'd like a calculated field that automatically does this, so I can just say:
SELECT ACCT_NUMBER FROM ACCOUNT_TABLE
What is the best way to do this?
I'm using SQL Server 2005.