LabVIEW(數(shù)據(jù)庫(kù)連接)
Dbq=路徑;
本文引用地址:http://m.butianyuan.cn/article/201612/334157.htmUid=Admin;
Pwd=密碼;
插入:
INSERT INTO xs(學(xué)號(hào),姓名,專(zhuān)業(yè)名,性別,出生日期,身高,黨員否) VALUES (082212,李曉姝,機(jī)電一體化,女,1990-9-28,168,0)
也可以:
INSERT INTO xs VALUES (082212,李曉姝,機(jī)電一體化,女,1990-9-28,168,0,NULL)
刪除:
DELETE FROM xs WHERE 專(zhuān)業(yè)名=機(jī)電一體化
刪除所有行: DELETE FROM xs
修改記錄:
xs表中所有學(xué)生成績(jī)加10分:UPDATE xs_kc SET 成績(jī)=成績(jī)+10
姓名為李曉姝的同學(xué)專(zhuān)業(yè)改為“通信工程”,備注改為“轉(zhuǎn)專(zhuān)業(yè)學(xué)習(xí)”,學(xué)號(hào)改為082141
UPDATE xs
SET 專(zhuān)業(yè)名=通信工程,
備注=轉(zhuǎn)專(zhuān)業(yè)學(xué)習(xí),
學(xué)號(hào)=082141
WHERE 姓名=李曉姝
查詢:
SELECT * FROM xs WHERE 專(zhuān)業(yè)名=通信工程
SELECT * FORM xs WHERE 身高>=170
SELECT * FORM xs WHERE 專(zhuān)業(yè)名=通信工程 OR 專(zhuān)業(yè)名=計(jì)算機(jī)網(wǎng)絡(luò)
SELECT * FORM xsWHERE專(zhuān)業(yè)名=計(jì)算機(jī)網(wǎng)絡(luò) AND 性別=男
SELECT * FORM xsWHERE 出生日期 BETWEEN 1990-1-1 AND 1990-12-31 等價(jià)于 SELECT * FORM xsWHERE 出生日期>=1990-1-1 AND 出生日期<=1990-12-31
SELECT * FORM xsWHERE IN(計(jì)算機(jī)網(wǎng)絡(luò),計(jì)算機(jī)軟件,通信工程) 等價(jià)于 SELECT * FORM xsWHERE 專(zhuān)業(yè)名=計(jì)算機(jī)網(wǎng)絡(luò) OR 專(zhuān)業(yè)名=計(jì)算機(jī)軟件 OR 專(zhuān)業(yè)名=通信工程
SELECT * FORM xsWHERE 姓名 LIKE 王%
DESC :按遞減輸出
ASC:按遞增輸出
select * from student order by age desc , id desc;用“,”號(hào)隔開(kāi)多個(gè)排序條件,這樣,先按age 再按id,就是說(shuō),先按age從大到小排序,如果有相同年齡的,那么相同年齡的學(xué)生再按他們的id從大到小排序。
select sno, avg(DISTINCT grade) as 平均成績(jī)from SCgroup by snowhere avg(DISTINCT grade)>70order by avg(grade) desc
評(píng)論