Aliasing Problem In SQL Query
-
Hello Everybody, I have generate a problem While Aliasing Query. SQL Command is : Select S_no as S. No. From Emp;
If you can think then I Can.
the alias name should be a valid identifier, no punctuation, no spaces,... :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
-
Hello Everybody, I have generate a problem While Aliasing Query. SQL Command is : Select S_no as S. No. From Emp;
If you can think then I Can.
Select S_no as [S. No.] From Emp;
would work but as Luc said that its not best practice.
As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
-
Select S_no as [S. No.] From Emp;
would work but as Luc said that its not best practice.
As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
-
what sort of error message did you get?
As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
-
what sort of error message did you get?
As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
-
try
select columnName as S_NO from tablename
As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
-
You're real problem is that you are putting UI information into the query, this type of formatting belongs in your user interface no the database Oh and this does work in sql server 2005/08
SELECT ship [S. No.] FROM Ship AS S
Never underestimate the power of human stupidity RAH
-
Hello Everybody, I have generate a problem While Aliasing Query. SQL Command is : Select S_no as S. No. From Emp;
If you can think then I Can.
-
Hello Everybody, I have generate a problem While Aliasing Query. SQL Command is : Select S_no as S. No. From Emp;
If you can think then I Can.
In SQL query '.' can be used to get a column from a table... For eg : "Select Employee.EmpId from Employee" So Sql always expects a column name after a '.' , use some other characters as alias names. This would solve your problem
-
Hello Everybody, I have generate a problem While Aliasing Query. SQL Command is : Select S_no as S. No. From Emp;
If you can think then I Can.
Use a valid identifier. Dot is not a valid identifier.
-
Use a valid identifier. Dot is not a valid identifier.