使用SQL查询数据库表
目前在Java的Android Studio中进行项目,我正在尝试查询SQL的两个桌子。 表如下:
预订表
/I.SSTATIC.NET/7HXYD.PNG“ alt =” user_bookings table>
用户表仅用于参考
noreferrer”>
例如,对于具有ID 2的用户,我想从预订表中出发时间&出发日期(12:30& 12/5/20222)和从User_bookings表中我想要人数(2)。
还是联盟/内部加入不是我要实现的目标的正确操作员?由于我一直在尝试和刷新我的SQL技能,但我似乎无法领先。
任何帮助都赞赏。
Currently doing a project in android studio in java and I'm trying to query two tables in sql.
The tables are as follows:
Bookings table
User_Bookings table
User table just for reference
Is there a way do to a UNION or INNER JOIN and connect these two tables with just the userID ?
Say for example for the user with ID 2 I want from the Bookings table the departure time & departure date (12:30 & 12/5/20222) and from the User_Bookings table I want the number of people (2).
Or is UNION/INNER JOIN not the right operators for what I am trying to achieve ? As I have been trying and brushing up on my SQL skills but I can't seem to get ahead of it.
Any help appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)