mysql中我要查出某個值在查出來的N條資料中是第幾條資料,這個怎麼查

2021-03-29 00:26:01 字數 1638 閱讀 8692

1樓:匿名使用者

我想到一個:

//前面不用說吧

mysql_query(select * table where file='velue')

while($row=mysql_fecth_array)echo $i //i就是你想要的結果,應該看的明吧。

2樓:匿名使用者

select count(*) from table where name = ***

mysql根據某欄位查詢表裡的前幾條資料的查詢語句

3樓:匿名使用者

select * from 表名 where 條件 order by 欄位 desc limit 100;

4樓:匿名使用者

select top 100 *

from

表order by

時間 desc

mysql查出n條資料,其中有四條資料兩兩重複,還有其他的也是這樣,如何去重?

5樓:遇到不靠譜君

select * from(

select * from customer where user=(

select source_user from customer where user='admin') union all select * from customer where user=(

select source_user from customer where user=(

select source_user from customer where user='admin')) union all select * from customer where user=(

select source_user from customer where user=(

select source_user from customer where user=(

select source_user from customer where user='admin'))) union all select * from customer where source_user=(/*我的上線的上線的user*/

select user from customer where user=(

select source_user from customer where user=(

select source_user from customer where user='admin'))) union all select * from customer where source_user=(/*我的上線的上線的上線user*/

select user from customer where user=(

select source_user from customer where user=(

select source_user from customer where user=(

select source_user from customer where user='admin'))))) as alias group by user;

如何使用MySQL查詢某個列中相同值的數量統計

select count 求值的欄位 from 表名 where 列名 某個值 sum 是求這些值相加的和,count是統計數量 select sum 求值的欄位 from 表名 如何使用mysql查詢某個列中相同值的數量統計 可以通過用該欄位分組計數獲得。例如 select col1,count ...

在mysql資料庫中如何讓某個欄位有重複的只取一條

保留相 同a值的最小id行 select from table a a where not exists select 1 from table a bwhere b.a a.a and b.id a.id select from table a where id in select min id ...

EXCEL中在區域中查詢某個值,返回與之相同單元格的行號和列號

1 開啟excel,匯入資料。將通過在f2中輸入公式,並向右側複製,向下復 返回滿足班級為9班並屬且是班級幹部的記錄。2 返回一個邏輯值組成的陣列,如果陣列元素是true說明該位置的資料是9班,如果陣列元素是false說明該位置的資料不是9班。3 not巢狀isblank函式返回職位由邏輯值組成的陣...