合并两个Select语句 [英] Combine two Selects statements

查看:130
本文介绍了合并两个Select语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个SELECT产生此结果,

Suppose that I have one SELECT that produce this,

Number   Person
   1     Mary,Cleveland, Supervisor
   2     John,Illinois, Programmer
   3     Victor, Albany,Engineer
   4     Melissa, Alaska, Chemical
   5     Tom, Honolulu, Vendor
   6     Sam, New Mexico, Programmer


和其他产品,


and the other produces,

Number   PrivateInfo
   1     Start Date
   1     Start Date
   1     Start Date
   2     Salary
   2     Salary
   2     Salary


我需要将PrivateInfo添加到第一个SELECT中,但是我不能,因为它给出了一个错误,即我无法在其内部使用多个select语句.


I need to add PrivateInfo to the first SELECT, but I cant because its giving a error that I cant use more than one select statement inside itself.

推荐答案

听起来像你正在寻找多表SELECT.看看适合您的SQL风格的JOIN关键字的语法.
Sounds like you''re looking for a multi-table SELECT. Take a look at the JOIN keyword''s syntax for your flavor of SQL.


这篇关于合并两个Select语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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