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 |
|
samsun125
Yak Posting Veteran
63 Posts |
Posted - 2009-01-08 : 08:51:00
|
| Hi all,i have 3 tables 1.companies columns are companyid(p.k),companyname2.companycountrymappings columns are rowid(P.K),companyid(F.K),countryid(F.K)1.locationscolumns are countryid(P.K),countrynamewhat i want to do is i want to get companyid,companyname based on country.i want to write query without using joins,subqueries & views.any other option ,my requirement is like this If anybody knows please help meThanks & RegardsRama |
|
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2009-01-08 : 08:55:00
|
| without using joins?? are you sure that's your requirement?Em |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-01-08 : 08:57:23
|
Let him use IN or EXISTS instead.If he wants to go have some coffee or tea while query is running, it's his choice. E 12°55'05.63"N 56°04'39.26" |
 |
|
|
samsun125
Yak Posting Veteran
63 Posts |
Posted - 2009-01-08 : 09:01:11
|
| yes they don't joins,subqueries,views.they are telling using the above features it will hit the performance.please help me on this |
 |
|
|
raky
Aged Yak Warrior
767 Posts |
Posted - 2009-01-08 : 09:03:30
|
| select cp.companyid,cp.companyname from companies cp,companycountrymappings ccm ,locationscolumns lcwhere cp.companyid = ccm.companyid and ccm.countryid = lc.countryid and lc.countryname = 'yourcountry' |
 |
|
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2009-01-08 : 09:06:49
|
| raky... i think you'll find that's a join dudeEm |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-01-08 : 09:09:14
|
Raky may be right in this particular scenario.Maybe OP got an "browser" of his own that do not accept "JOIN" keyword? E 12°55'05.63"N 56°04'39.26" |
 |
|
|
|
|
|
|
|