如何在这里使用不同的fn? [英] how to use distinct fn here?

查看:84
本文介绍了如何在这里使用不同的fn?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用sql 2005,具有源,目标,通过和日期的表评估列.现在,我想通过给出源来检索目标的不同值.我现在正在使用以下查询(2个查询)..

Hi,
I''m using sql 2005,having a table compraises of source,destination,via and date as columns. Now i want to retrieve the distinct values of destination and via by giving source. I am using the following query now(2 queries)..

select distinct DESTINATION from BUS AVAILABILITY WHERE SOURCE =@SOURCE
select distinct VIA from BUS AVAILABILITY WHERE SOURCE =@SOURCE



我可以将其作为单个查询加入,或者应该像这样.
由于是初学者,所以我不知道如何在此处使用区别.



It is possible for me to join as an single query or it should be like this.
since am an beginner,I don''t know how to use the distinction here.

推荐答案

SELECT Distinct DESTINATION,VIA from  BUS AVAILABILITY WHERE SOURCE =@SOURCE




希望这会有所帮助,如果是,请接受并投票,否则将返回您的答案
--Rahul D.




Hope this helps if yes then accept and vote the answer otherwise revert back with your answer
--Rahul D.


select distinct (DESTINATION) from BUS AVAILABILITY WHERE SOURCE =@SOURCE




有关SQL查询的更多信息,请访问网站"WWW.W3Scgools.com"

希望对您有帮助




for more to know about SQL queries visit the website "WWW.W3Scgools.com"

hope this may help you


大家好..


最后我在这里使用并集函数得到了答案...
感谢您的帮助...........
Hi all..


finally i got an answer by using union function here...
thanks for your help...........


这篇关于如何在这里使用不同的fn?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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