Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Better way than UNION

Author  Topic 

skillile
Posting Yak Master

208 Posts

Posted - 2005-02-25 : 11:02:45
Is there a better way to return this data then a UNION.

SELECT
linkid
,linkname
FROM global_links

UNION

SELECT
linkid
,linkname
FROM user_links
WHERE ...



slow down to move faster...

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-02-25 : 11:04:33
don't think so.

Go with the flow & have fun! Else fight the flow
Go to Top of Page

Xerxes
Aged Yak Warrior

666 Posts

Posted - 2005-02-25 : 11:07:09
quote:
Originally posted by skillile

Is there a better way to return this data then a UNION.

SELECT
linkid
,linkname
FROM global_links

UNION

SELECT
linkid
,linkname
FROM user_links
WHERE ...



slow down to move faster...



What is it exactly that you're attempting to do, skillile?

Semper fi,

XERXES, USMC(Ret.)
------------------------------------------------------
The Marine Corps taught me everything but SQL!
Go to Top of Page

skillile
Posting Yak Master

208 Posts

Posted - 2005-02-25 : 11:13:46
I got it working now but,

I may need to group by and where like this..

select
...
from inner ...
where
group

union


select
...
from inner ...
where
group


I thought there may be a way to select all and add another select using ?? derived table, something more efficient.

Not sure just a question.




slow down to move faster...
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2005-02-25 : 11:24:53
UNION ALL is more efficient, if you don't need to remove duplicates.

- Jeff
Go to Top of Page
   

- Advertisement -