Hi Everyone,
How I can write a query and pull values from 2 tables having different number of columns and having no primary key.
I tried using SQL UNION ALL command, but his brings me only the common columns. My requirement is i need to pull all the columns from 2 tables for a particular query.
Example: Let table T1 Information related to schools and has 6 columns like SchoolID, SchoolName, City,County, Phone number, Ownedby
and T2 has 5 columns HospitalID, Hospital Name, City, County, Ownedby.
Now I need a query like this, If I enter the city name and hit enter, it should bring all the School information and Hospital information in that city.
P.S: In original data I have 59 columns in Table 1 and 57 in Table 2.
Thanks in advance!
How I can write a query and pull values from 2 tables having different number of columns and having no primary key.
I tried using SQL UNION ALL command, but his brings me only the common columns. My requirement is i need to pull all the columns from 2 tables for a particular query.
Example: Let table T1 Information related to schools and has 6 columns like SchoolID, SchoolName, City,County, Phone number, Ownedby
and T2 has 5 columns HospitalID, Hospital Name, City, County, Ownedby.
Now I need a query like this, If I enter the city name and hit enter, it should bring all the School information and Hospital information in that city.
P.S: In original data I have 59 columns in Table 1 and 57 in Table 2.
Thanks in advance!