This question already has answers here:
When to use single quotes, double quotes, and backticks in MySQL
                                
                                    (12个答案)
                                
                        
                                2年前关闭。
            
                    
输入此SQL语句时,我被设置为空,有人可以告诉我为什么吗?

select ayr,mods.mid,mtitle,credits
from mods,comp
where mods,mid = comp.mid and ayr = 2001/02;


当省略“ ayr = 2001/02”时,它将显示正确的内容。

最佳答案

您需要日期前后的报价

select ayr,mods.mid,mtitle,credits
from mods,comp
where mods,mid = comp.mid and ayr = '2001/02';

10-08 19:44