Warning

 

Close
Confirm Action

Are you sure you wish to do this?

Cancel Confirm
AR15.COM
3/26/2015 1:03:46 PM EDT
I'm running a SQL query, but want to add a character to the output.

I'm pulling SSN numbers and want the output to be the SSN with an "A" tagged to the end.

Help a dude out?
3/26/2015 1:06:42 PM EDT
[#1]
It really depends on the RDBMS you're querying, but I've used to following:

Oracle - using the double vertical pipe to concatenate
SELECT SSN_NUM||'A' FROM <table>

MS SQL
SELECT SSN_NUM + 'A' from <table>

Add on your WHERE clause, include additional fields, and go to town
3/26/2015 1:09:43 PM EDT
[#2]
thank you kind sir - MSSQL and that worked.

Close Join Our Mail List to Stay Up To Date! Win a FREE Membership!

Sign up for the ARFCOM weekly newsletter and be entered to win a free ARFCOM membership. One new winner* is announced every week!

You will receive an email every Friday morning featuring the latest chatter from the hottest topics, breaking news surrounding legislation, as well as exclusive deals only available to ARFCOM email subscribers.


By signing up you agree to our User Agreement. *Must have a registered ARFCOM account to win.