SQL Select语句---在select语句中有多个表和特定行

时间:2017-07-27 21:08:20

标签: database select sqlclient

我想知道在SELECT语句中选择数据库中多于一个表的正确方法是什么?目前我尝试使用这个执行两者的代码,但第一个SELECT状态由第二个`

重写
        con.Open();
        ds.Clear();
        da.SelectCommand = new SqlCommand("SELECT id, username, ime, prezime FROM student", con);
        da.SelectCommand.ExecuteNonQuery();

        da.SelectCommand = new SqlCommand("SELECT odjel, smjer FROM studij", con);
        da.SelectCommand.ExecuteNonQuery();
        da.Fill(ds);

        dg.DataSource = ds.Tables[0];

        con.Close();`

我一直在尝试在表之间使用AND,但它不起作用

        con.Open();
        ds.Clear();

        da.SelectCommand = new SqlCommand("SELECT id, username, ime, prezime FROM student AND odjel, smjer FROM studij", con);        
        da.Fill(ds);

        dg.DataSource = ds.Tables[0];

        con.Close();

我不需要使用整个表格,只需要一些行,所以 - > SELECT * FROM student,studij< ---不会对我有任何帮助。 如何从多个数据库表中进行选择以在Datagrid中显示?

1 个答案:

答案 0 :(得分:0)

答案是使用

const customSvg = document.createElement("svg")
const properSvg = document.createElementNS("http://www.w3.org/2000/svg", "svg")

console.log(customSvg instanceof SVGSVGElement) // false
console.log(properSvg instanceof SVGSVGElement) // true

console.log(customSvg.width) // undefined
console.log(properSvg.width) // SVGAnimatedLength {}
相关问题