mysql查詢的問題

時間 2022-03-13 22:20:13

1樓:

select *

from a a,b b

where find_in_set(a.catid,b.catid)>0

order by addtime desc

2樓:匿名使用者

select a.catid,b.catd into acatid,bcatid from a a,b b where a.

catid=b.catid order by addtime desc

查出來的結果列印一下就明白了。

3樓:野草

select * from a a,b b where a.catid=b.catid order by addtime desc

這麼寫應該可以a b 連線起來呀

4樓:匿名使用者

第一點, a b表 都叫a b了 怎麼又取別名叫 ab? 費解。

*****====

切入主題:

你等問題在於 addtime 欄位不明確 你select * from a,b;

我不知道你的addtime是在a表 還是在b表,或者是2表都沒有加入在a表

select * from a,b where a.catid = b.catid order by a.addtime desc;

在b表就

select * from a,b where a.catid = b.catid order by b.addtime desc;

要指定明確

mysql選擇表查詢的問題,當表A中存在記錄則輸出A表資料,否則輸出B表資料

select id name,other from select nvl a.id,b.id id nvl a.name,b.name name nvl a.other,b.other other from a full outer join b on a.name b.name where nam...

mysql迴圈統計問題,我要查詢大的職位分類下面的小分類,並統計出小分類裡有釋出多少個職位

不知道你是啥意思,好久沒寫sql了。隨便寫了個,應該是有問題的。你看下思路對不對吧。select dafenlei colume as fenlei,count as num from select distinct xiaofenlei colume dafenlei colume from ta...

linux系統如何查詢mysql所在埠

my.ini linux系統下是my.cnf 當mysql伺服器啟動時它會讀取這個檔案,設定相關的執行環境引數。此檔案中有乙個引數是 port port 3306 設定mysql客戶端連線服務端時預設使用的埠 找到mysql執行目錄下的my.ini linux系統下是my.cnf 檢視此引數即可。l...