简体   繁体   English

MySQL 返回一个空的结果集(即零行)。 (查询耗时 0.0034 秒。)

[英]MySQL returned an empty result set (i.e. zero rows). (Query took 0.0034 seconds.)

I Want to join the two tables data and one location and the other one is trip when ever i query for the the one table its show the data but whenever i use the query to join two rows it wont fetch the table result我想连接两个表的数据和一个位置,另一个是旅行,当我查询一张表时,它会显示数据,但是每当我使用查询连接两行时,它都不会获取表结果

Here is my query这是我的查询

SELECT trip.Trip_Name ,trip.Trip_ID , trip.Trip_Date , location.Location_Name , location.Location_ID 
FROM location 
INNER JOIN trip ON trip.Trip_ID = location.Location_ID

i think trip_id is not the same as location_id我认为 trip_id 与 location_id 不一样

the trip table containt trip's information and the location containt the location's information行程表包含行程信息,位置包含位置信息

so in order to make join you should make a new column named "location_id" in trip as foreign key and location.location_id as primary key所以为了加入你应该在trip中创建一个名为“location_id”的新列作为外键和location.location_id作为主键

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM