Last post Jan 29, 2015 05:25 AM by Zhi Lv - MSFT
Apr 15, 2014 11:22 AM|human2x|LINK
I need to join data from two tables but without using left join statement.
select t1.*,t2.* from t1,t2 where t1.id=t2.id;
The above statement shows only matched records from both tables.
BUT I need to select ALL records from t1 and matched records from t2.
For ex if t1 has 10 records and t2 matches t1 in 4 records only, then the result must show 10 records.
I don't want to use (LEFT JOIN), because I noticed that it takes longer time than using (WHERE) clause.
In oracle I could use: where t1.id(+)=t2.id
select t1.*,t2.* from t1,t2 where t1.id(+)=t2.id;
Apr 16, 2014 06:43 AM|Select query|LINK
string sql1 = @"select ID,Name from Person ";
string sql2 = @"select FirstName, LastName from Person";
string sql = sql1 + sql2;
// Create connection
MySqlConnection conn = new MySqlConnection(connString);
// Open connection
// Create command
MySqlCommand cmd = new MySqlCommand(sql, conn);
catch (MySqlException ex)
Jan 29, 2015 05:25 AM|Zhi Lv - MSFT|LINK
As for this issue, I suppose we can achieve it using following steps.