内部联接即将到来的一些问题 [英] inner join some problem is coming
本文介绍了内部联接即将到来的一些问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
表:
型号int
说明varchar
价格int
现在我想展示价格相同的模型...我已经尝试过了
Table:
Model No int
Description varchar
Price int
now i want to show the models that have same price...I have tried with this
select distinct(Objpc1.Model),Objpc.Model from pc Objpc1 , Pc Objpc
where Objpc.Price=Objpc1.Price and Objpc.Model!=Objpc1.Model
IAM得到的输出是
The output iam getting is
1232 1233
1233 1232
但我需要将其显示为1233和1232或1232和1233 ????
but i need to show either of this as 1233 and 1232 or 1232 and 1233????
推荐答案
select Objpc1.Model,Objpc.Model from pc Objpc1 INNER JOIN Pc Objpc
ON Objpc.Price=Objpc1.Price
select distinct(Objpc1.Model),Objpc.Model from pc Objpc1 , Pc Objpc
where Objpc.Price=Objpc1.Price and Objpc.Model!=Objpc1.Model and Objpc.model<Objpc1.model
这篇关于内部联接即将到来的一些问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文