Mysql SQL显示多列
我想做的是展示亚洲和欧洲国家的所有信息,而不是其他大陆的信息。然后按大陆订购。我只是错过了一些明显的东西,但那是什么 如果我把和放在亚洲和欧洲之间,那么它将试图显示来自亚洲和欧洲的国家,所以这不起作用,但如果我把放在亚洲和欧洲之间,那么它将只显示亚洲 我的代码是什么样子的Mysql SQL显示多列,mysql,sql,Mysql,Sql,我想做的是展示亚洲和欧洲国家的所有信息,而不是其他大陆的信息。然后按大陆订购。我只是错过了一些明显的东西,但那是什么 如果我把和放在亚洲和欧洲之间,那么它将试图显示来自亚洲和欧洲的国家,所以这不起作用,但如果我把放在亚洲和欧洲之间,那么它将只显示亚洲 我的代码是什么样子的 SELECT * FROM country WHERE Continent = 'Asia' AND 'Europe' ORDER BY Continent DESC; 试着跟随 SELECT * FROM country
SELECT *
FROM country
WHERE Continent = 'Asia' AND 'Europe'
ORDER BY Continent DESC;
试着跟随
SELECT * FROM country
WHERE Continent in ('Asia','Europe')
ORDER BY Continent DESC;
试一试
或
试试这个
SELECT * FROM country
WHERE Continent In( 'Asia' , 'Europe')
ORDER BY Continent DESC;
(或)
(或)
万一你想要非非洲人和澳大利亚人
SELECT *
FROM country
WHERE !(Continent = "Africa" AND Continent = "Australia")
ORDER BY Continent DESC;
谢谢,伙计。很好,我理解我现在做错了什么。解决了,谢谢大家。世界上有四大洲。
SELECT * FROM country
WHERE Continent = 'Asia' OR Continent = 'Europe'
ORDER BY Continent DESC;
SELECT * FROM country
WHERE Continent In( 'Asia' , 'Europe')
ORDER BY Continent DESC;
SELECT * FROM country
WHERE Continent ='Asia' OR Continent= 'Europe'
ORDER BY Continent DESC;
SELECT * FROM country
WHERE Continent ='Asia'
ORDER BY Continent DESC;
UNION ALL
SELECT * FROM country
WHERE Continent ='Europe'
ORDER BY Continent DESC;
SELECT *
FROM country
WHERE Continent = "Africa" OR Continent = "Australia"
ORDER BY Continent DESC;
SELECT *
FROM country
WHERE !(Continent = "Africa" AND Continent = "Australia")
ORDER BY Continent DESC;