这段SQL语句在java里就是编译不过去,提示说'.' 附近有语法错误。,代码我已在SQL上运行过,可以查出数据
"selectPost,PurviewfromHotel.dbo.loginast1"+"LEFTJOIN"+"(SELECTID,Post,Purview,Name,A...
"select Post,Purview from Hotel.dbo.login as t1" +
"LEFT JOIN" +
"(SELECT ID,Post,Purview,Name,Age,Sex,Address,Telephone" +
"from Hotel.dbo.users )as t2" +
"on t1.ID=t2.ID" +
"where Username=? and Password=?" 展开
"LEFT JOIN" +
"(SELECT ID,Post,Purview,Name,Age,Sex,Address,Telephone" +
"from Hotel.dbo.users )as t2" +
"on t1.ID=t2.ID" +
"where Username=? and Password=?" 展开
展开全部
t1和left之间没有空格
Telephone和from之间没有空格
你试试下面的
"select Post,Purview from Hotel.dbo.login as t1 " +
"LEFT JOIN" + "(SELECT ID,Post,Purview,Name,Age,Sex,Address,Telephone" + " from Hotel.dbo.users )as t2"
+ "on t1.ID=t2.ID" + "where Username=? and Password=?";
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询