Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/64.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 HQL查询不同的列_Mysql_Sql_Hql - Fatal编程技术网

Mysql HQL查询不同的列

Mysql HQL查询不同的列,mysql,sql,hql,Mysql,Sql,Hql,我正在查询表Airport中名称为“term%”的行,并按名称排序。它看起来像这样,而且工作正常: from Airport where name like 'term%' order by name 现在,我想在同一个查询中的city列中查找“term%”,但我无法让它工作。 我想要这样的东西,但这不对: from Airport where name like 'term%' or where city like 'term%' order by named 您应该只有一个,其中: f

我正在查询表Airport中名称为“term%”的行,并按名称排序。它看起来像这样,而且工作正常:

from Airport where name like 'term%' order by name
现在,我想在同一个查询中的city列中查找“term%”,但我无法让它工作。 我想要这样的东西,但这不对:

 from Airport where name like 'term%' or where city like 'term%' order by named

您应该只有一个
,其中

from Airport where name like 'term%' or city like 'term%' order by name
查询应该是

from Airport where name like 'term%' or city like 'term%' order by name  
而不是

from Airport where name like 'term%' or where city like 'term%' order by named  
只使用一个
where
子句及其
name
not
named