刚学mysql,问下大家为什么查询不到结果呢?

我创建好表格填好了数据,但是查询报错

这是我的查询代码select sno,sname where sex="男" and age>21 from s

运行后出现了下面这个错误

[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from s' at line 1

下载好之后我的文件位置没有改成默认的,不知道是不是这个影响的,但是我在选项里找不到文件位置,没有办法改正,这里寻求大家的帮助

select sno,sname where sex="男" and age>21 from s
改为
select sno,sname from s where sex='男' and age>21

where语句要放后面,而且字符用单引号

img

您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!
PS:问答VIP年卡 【限时加赠:IT技术图书免费领】,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632