I want to fetch data from three different table in sql database.
My scenario is like.
DEF 002 102
From three table MasterA , MasterB , MasterC I required the below result
NAME ID Class
ABC 101 C1
ABC 101 C2
DEF 102 C3 S1
DEF 102 C2
Can you please explain the logic for the result?
If you simply join all 3 tables by the column "Name" you would get 1 * 2 * 3 = 6 times "ABC" in the result; but you want only 3 times ABC.
There seems to be a relation between MasterB and MasterC missing.
* cogito ergo sum * errare humanum est * quote erat demonstrandum *
Wenn ich denke, ist das ein Fehler und das beweise ich täglich
What ever you understood is correct. I want minimum number of rows containing all information from three table.
Like for ABC I want only 3 rows, I dont want 6 row.
There is Name is comman between all three table. There is no relation between MasterB and MasterC.
If you want any further detail let me know.
Microsoft is conducting an online survey to understand your opinion of the Technet Web site. If you choose to participate, the online survey will be presented to you when you leave the Technet Web site.
Would you like to participate?