从表中选择前1个并选择一些列 [英] select top 1 from table and select some columns

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

问题描述

大家好,

你能帮我这个忙吗?
我有桌子t1,t2,t3
3表格ID中的公共列.
现在我想从t1,t2,t3中选择t1.colm1,t1.clom2,t2.clom1,t2.clom3,t3.clomn2并从t1表中选择top1 t1.clomn1并使用联接或任何其他类似方法从3表中获取数据使用id列的条件在3个表中很常见.

请帮助我.

高级谢谢.

问候,
Narasimha

Hi All,

Can you please help me on this.
I have tables t1,t2,t3
common column an in 3 tables id.
now i want select t1.colm1,t1.clom2,t2.clom1,t2.clom3,t3.clomn2 from t1,t2,t3 and selcet top1 t1.clomn1 from t1 table and get data from 3 table using joins or any other like where condition using id column is the common for 3 tables.

please help me on this.

Advanced Thank you.

Regards,
Narasimha

推荐答案

看看这个关于堆栈溢出的类似问题:
Have a look at this similar question on Stack Overflow: SQL Server: How to Join to first row[^].


您能详细说明问题吗?


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

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