VB資料庫記錄分類計數求救

2022-06-18 05:40:07 字數 941 閱讀 1432

1樓:匿名使用者

sql呀,用兩個 left join就可以了,什麼資料庫

2樓:匿名使用者

select 學歷,case when 年齡 between 40 and 50 count(姓名) end as 40-50歲,case when 年齡 between 28 and 36 count(姓名) end as 28-36歲 from table1 group by 學歷

3樓:繽心公主

buuhduei;afv1

4樓:

如果你對sql不太熟悉,建議你用判斷語句:

dim a,b,c,d,e,f

strsql="select * from table1"

rs.open strsql,db,2,2

do while not rs.eof

if rs("學歷")="高中" and rs("年齡")>=40 and rs("年齡")<=50 then a = a + 1

if rs("學歷")="高中" and rs("年齡")>=28 and rs("年齡")<=36 then b = b + 1

if rs("學歷")="初中" and rs("年齡")>=40 and rs("年齡")<=50 then c = c + 1

if rs("學歷")="初中" and rs("年齡")>=28 and rs("年齡")<=36 then d = d + 1

if rs("學歷")="大學" and rs("年齡")>=40 and rs("年齡")<=50 then e = e + 1

if rs("學歷")="大學" and rs("年齡")>=28 and rs("年齡")<=36 then f = f + 1

rs.movenext

loop

多級分類資料庫怎麼建表,二級分類的資料庫怎麼設計技術問答

你這個屬於無級樹的範圍,它建立只要三個基本欄位,父節點,子節點,名稱,比如fid int,cid int,fname nvarchar 50 屬於頂級節點的,fid預設為0就可以了,屬於子節點,fid就填所屬父節點的id 大類 編號 類名 id1 xx類 id2 xx類 id3 xx類 小類 大類i...

oracle資料庫操作記錄怎麼檢視

進資料庫日誌檔案裡看,檔名叫 alert sid.log sid 是例項名,文字檔案,在安裝目錄裡頭自己找。檢視歸檔模式 conn as sysdba archive log list 如果資料庫為歸檔模式的話,可以通過logmnr來進行挖掘日誌檔案檢視這些資訊的。如果是非歸檔模式。對不起無法檢視了...

VB如何實現查詢資料庫並顯示出來

可以快速匯出使用excel 就有該功能 使用這個模組就可以,你可以看看引用的函式即可 參考 如下 private sub command1 click on error goto errhandle dim cnn as new adodb.connection dim rs as new adod...