关键字"AS"附近的语法不正确 [英] Incorrect syntax near the keyword 'AS'
本文介绍了关键字"AS"附近的语法不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个名为student的表,现在我需要用id列过滤student表,并命名为另一个表,即s.在s表中,我需要得到s.id = dbo.toppers.id
的结果
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 s.id=dbo.toppers.id
(Select id,name from student)
as s
on s.id=dbo.toppers.id;
我收到错误消息关键字"AS"附近的语法不正确".
I am getting an error message "Incorrect syntax near the keyword ''AS''"
推荐答案
您的查询肯定看起来是错误的.我不太确定您要做什么.您是在别名为s的表中选择id = 5的学生的姓名吗?
然后尝试
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 id.name from student as s where s.id = 5
尝试dis
如果你想获得名字意味着
try dis
if u want to get name means
select name as s from student where id=5
否则,如果您想要ID表示
else if u want id means
select id as s from student where id=5
从学生s中选择s.id,s.name,其中s.id ="5";
可能对sql语法有用:
http://www.w3schools.com/sql/sql_select.asp [
select s.id, s.name from student s where s.id="5";
Perhaps helpful for sql syntax:
http://www.w3schools.com/sql/sql_select.asp[^]
这篇关于关键字"AS"附近的语法不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文