Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql SQL显示多列_Mysql_Sql - Fatal编程技术网

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;