i have 2 table.
Table1 : tb.Country
Table2 : tb.UserProfile
when user registered, i save just Index into tb.UserProfile.
Now i want get Index value from tb.country and show country name.
my query:
SELECT country_a FROM tb.UserProfile WHERE userid = 10
in (SELECT countryname FROM tb.country WHERE countryID = country_a )
meantime, I do not want
to use this approach would:
string countryId = conn.CheckCommand("SELECT country_a FROM tb.UserProfile WHERE userid='" + ID + "'");
conn.CheckCommand("SELECT countryname FROM tb.country WHERE countryid='" + countryId + "'");
how to use this request into one sql query?
Go to the complete details ...