Click here to Skip to main content
15,748,330 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have a table by name student, now I need to filter student table with columns id and name this will result into a another table namely s. In s table I need to get a result of
(Select id,name from student)
 as s 

I am getting an error message "Incorrect syntax near the keyword 'AS'"
Updated 1-Jun-11 21:28pm

You query definitely looks wrong. I'm not quite sure what you are trying to do. Are you selecting the name of a the student who's id = 5 in a table with alias s?

Then try
Select from student as s where = 5
Share this answer
Tarun.K.S 2-Jun-11 3:15am    
Oops you had already answered it! 5+
Abhinav S 2-Jun-11 3:20am    
No problem. :)
swathi6589 2-Jun-11 3:33am    
select id,name from student will result into a table namely x.I need to check the condition with table x
Tarun.K.S 2-Jun-11 4:10am    
Well you have updated your answer. Can you check mine if it worked for you?
try dis
if u want to get name means
select name as s from student where id=5 

else if u want id means
select id as s from student where id=5
Share this answer
select, from student s where"5";

Perhaps helpful for sql syntax:[^]
Share this answer
Hi Swathi,

Can you try this:
SELECT, FROM student AS s WHERE"5"


Then try this:

FROM student AS s
JOIN toppers
ON =
Share this answer
Tarun.K.S 2-Jun-11 3:22am    
Edit: Added s to id and name.
swathi6589 2-Jun-11 5:12am    
I think, I am not clear to u. By any query I will get a result in table form,can I use alias name for resulted table.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900