sql - Join not fetching data correctlly -


i have written procedure below lines of code.

select countryid, countryname,  countrycode, longitude, latitude, createdby, createdon, updatedon, updatedby country c exists (select top 1 1                 cause cs               cs.countryname c.countryname         ) 

basically there 2 tables country countryid , countryname fields , cause 3 fields: causeid, causename , countryname.

i trying fetch countries assigned cause. above code not working.

select *  country c  inner join cause cs on cs.countryname = c.countryname 

this countries have causes. hope understood wanted.

this works if cs.countryname identical c.countryname. mind fact exists takes longer join , consider indexing countryname column


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -