如何从两个表中选择值 [英] how to select values from two tables

查看:117
本文介绍了如何从两个表中选择值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个表artstails和artdetails artsId是artdetails表中arts table外键的主键.我正在从两个表中选择值,但是查询给出错误为无效的对象名称"artdetails"".我的查询是:

I have two tables arts and artdetails artsId is the primary key in arts table foreign key in artdetails table. I am selecting values from both table but my query is giving error as "Invalid object name ''artdetails''" My query is:

select arts.artsId, artdetails.mainImage from artdetails INNER JOIN arts ON artdetails.artsId=arts.artsId;


请帮忙.


Please help.

推荐答案

您在问题中说该表名为artsdetails,但在查询中您已使用artdetails
You stated in your question that the table was called artsdetails but in your query you have used artdetails


确保您从执行"按钮附近的数据库组合框中选择了正确的数据库
make sure you are select correct database from database combobox near Execute button


这篇关于如何从两个表中选择值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆