sql - FULL OUTER JOIN or UNION? -


How can it be confused or confused with the whole union? I want to be involved in the results like this:

  Table 1 Table 2 --------------- ---------- --- ---- ID name salary ID return --------------------------------- 1 John 1000 1 Sepals 1 Henry 4000 1 mango 1 smith 1000 1 tomato  

should be the result

  ResultTable ---------------- --- ----- ID name pay fruit ----------------------- 1 John 1000 sepals 1 John 1000 mangoes 1 John 1000 tomato 1 Henry 4000 Sepels 1 Henry 4000 megons 1 Henry 4000 tomato 1 Smith 1000 Sepels 1 Smith 1000 mangoes 1 Smith 1000 Tomatoes  < / Pre> 

You need to join a cartesian product or cross-joint.

 < Table 1 Cross Joyce Tables 2 from Code> SELECT * to Table 1, Table 2  

or

  SELECT *  
< P> (context :)


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -