Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/56.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/77.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_Subquery - Fatal编程技术网

Mysql SQL-返回数据库中最短授课时间的项目

Mysql SQL-返回数据库中最短授课时间的项目,mysql,sql,subquery,Mysql,Sql,Subquery,尝试检索具有最短授课时间的模块名称 我的表格是cs\u课程模块,如下所示: module_name | module_id | etc | lecture_hours| semester_taught | --------------------------------------------------------------------------- Computing CS11002 5 22 firs

尝试检索具有最短授课时间的模块名称

我的表格是cs\u课程模块,如下所示:

module_name      |   module_id   |  etc  | lecture_hours| semester_taught |
---------------------------------------------------------------------------
Computing               CS11002     5       22          first semester 
Mathematics             CS11003     5       33          first semester
Advanced Math           CS22001     5       22          first semester
Data Structures         CS22002     5       33          first semester 
Computer Architecture   CS22003     5       33          first semester
它应返回:

高等数学与数学 计算

我的问题是:

SELECT module_name
FROM cs_course_modules
WHERE
    lecture_hours=(
        SELECT 
            MIN(lecture_hours)
        FROM
            cs_course_modules);
我得到一个错误:“表cs_模块不存在”


如果您能为我提供任何指导,我将不胜感激。

请检查您定义表格的模式。 有时,如果未定义同义词,则必须使用架构名称限定表名。 e、 g.如果employee表是在模式emp中定义的,那么如果您从不同的模式运行查询(假设另一个模式可以访问employee表),则应该使用

选择*
来自emp员工

您的查询。您是否在正确的数据库中工作,因为您的表中没有数据库?