December 13, 2013 at 9:48 pm
Hello,
I'm retrieving data using where statement, and do get data from table as expected. My question is, is it possible to rename that data?
My table has list of IP addresses, and I want to either add name or completely rename what is displayed.
Is it possible to do this using SQL queries?
Thanks!
December 13, 2013 at 9:57 pm
Could you give an example of what you mean by "rename output data"? Do you mean aliasing column names so they display as something other than their original names in the table?
SELECT FName AS FirstName
FROM MyTable;
or did you mean to modify/overwrite column data?
December 13, 2013 at 10:18 pm
Thanks for the reply.
I'm queuing specific data from column called Node Alias, for example:
NodeAlias = '101.101.101.101' or NodeAlias = '102.102.102.102' etc.
So, my reporting works, but I want to rename what is viewed in report (if 101.101.101.101, then name is "UniqueName" or add to the name "101.101.101.101 - Unique Name).
Hope it makes sense.
December 13, 2013 at 11:48 pm
I'm queuing specific data from column called Node Alias, for example:
NodeAlias = '101.101.101.101' or NodeAlias = '102.102.102.102' etc.
So, my reporting works, but I want to rename what is viewed in report (if 101.101.101.101, then name is "UniqueName" or add to the name "101.101.101.101 - Unique Name).
Rename what? a column? Or is this a new textbox that you want in your report? You can set the visibility of the textbox based on an expression, if you want.
January 3, 2014 at 3:18 pm
Do you mean something like this:
SELECT CASE NodeAlias WHEN '101.101.101.101' THEN 'UniqueName' ELSE 'Larry' END
FROM MyTable
or
SELECT NodeAlias + ' - ' + CASE NodeAlias WHEN '101.101.101.101' THEN 'UniqueName' ELSE 'Larry' END
FROM MyTable
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply