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.
| Author |
Topic |
|
csphard
Posting Yak Master
113 Posts |
Posted - 2004-11-29 : 16:47:31
|
| I am trying to get all the sect items in the profile table,and any that are in the sub sites table that are not in the profile table. The following represents the sql i created. The problem is that it only lists the items in the profile table and does not includethe ones that are only in the sub site table.select distinct sect from profile pleft join sub_sites s on p.sect = s.sectorder by p.sect |
|
|
JCamburn
Starting Member
31 Posts |
Posted - 2004-11-29 : 17:02:25
|
This will give you all the items in the profile tableSELECT sect FROM profile And this will give you all the items from sub_sitesSELECT sect FROM sub_sites If you want them all together, then UNION them.SELECT sect FROM profileUNIONSELECT sect FROM sub_sites Which will eliminate the duplicates for you. |
 |
|
|
rockmoose
SQL Natt Alfen
3279 Posts |
Posted - 2004-11-29 : 17:03:27
|
select sect from profileunionselect sect from sub_sitesrockmoose |
 |
|
|
|
|
|