SQLite与MySql、Oracle的使用区别(C#)

1.参数

SQLiteParameter p = new SQLiteParameter(":project_id", DbType.String);
p.Value = project_id;
 MySqlParameter p = new MySqlParameter("?project_id", MySqlDbType.VarChar);
 p.Value = project_id;
 OracleParameter p = new OracleParameter(":project_id", OracleDbType.Varchar2);
 p.Value = project_id;

2.参数类型

SQLite参数类型通过DbType设置,MySql参数类型通过MySqlDbType设置,Oracle参数类型通过OracleDbType配置爱

SQLite参数 :

SQLiteParameter[] p = {
                    new SQLiteParameter(":project_id", DbType.String),
                    new SQLiteParameter(":project_name", DbType.String),
                    new SQLiteParameter(":project_outer_name", DbType.String),
                    new SQLiteParameter(":project_status", DbType.String),
                    new SQLiteParameter(":project_type",DbType.String),
                    new SQLiteParameter(":hardware_platform",DbType.String),
                    new SQLiteParameter(":platform_model",DbType.String),
                    new SQLiteParameter(":leader_name",DbType.String)
}
p[0]=project_id;
...

MySql参数: 

MySqlParameter[] p = {
                  //MySQL传参格式为:?参数
		        new MySqlParameter("?project_id", MySqlDbType.VarChar),
	            new MySqlParameter("?project_name", MySqlDbType.VarChar),
                new MySqlParameter("?project_outer_name", MySqlDbType.VarChar),
		        new MySqlParameter("?project_status", MySqlDbType.VarChar),
		        new MySqlParameter("?project_type",MySqlDbType.VarChar),
                new MySqlParameter("?hardware_platform",MySqlDbType.VarChar),
                new MySqlParameter("?platform_model",MySqlDbType.VarChar),
                new MySqlParameter("?leader_name",MySqlDbType.VarChar)
}
p[0]=project_id;
...

Oracle参数:

OracleParameter[] p = {
                     new OracleParameter("?project_id", OracleDbType.Varchar2,10),
	                new OracleParameter("?project_name", OracleDbType.Varchar2),
                    new OracleParameter("?project_outer_name", OracleDbType.Varchar2),
		            new OracleParameter("?project_status",OracleDbType.Varchar2),
		            new OracleParameter("?project_type",OracleDbType.Varchar2),
                    new OracleParameter("?hardware_platform",OracleDbType.Varchar2),
                    new OracleParameter("?platform_model",OracleDbType.Varchar2),
                    new OracleParameter("?leader_name",OracleDbType.Varchar2)
					
                                   };
p[0]=project_id;
...

SQL的Left Join、Right Join 和Inner Join

sql之left join、right join、inner join的区别

Left join(左联接):返回包括左表中的所有记录和右表中联结字段相等的记录 
Right join(右联接) :返回包括右表中的所有记录和左表中联结字段相等的记录
Inner join(内连接): 只返回两个表中联结字段相等的行

 

 

 

 

 

 

 

你可能感兴趣的:(数据库)