0

値が最初の1000行に存在するかどうか、および値が情報を返すかどうかを確認する方法。

何かのようなもの

select cme_fbid 
from table1 if exists(select cme_fbid from table1 limit 1000)
4

4 に答える 4

1
SELECT
    CASE 
        WHEN EXISTS(SELECT cme_fbid FROM table1 LIMIT 1000) THEN t.cme_fbid
        ELSE NULL
    END
    FROM table1 t
于 2012-10-28T10:26:18.133 に答える
1
select cme_fbid 
from table1
where cme_fbid in (
    select cme_fbid
    from table1
    limit 1000)

order by一貫性のある/意味のある結果を得るには、おそらく内部クエリにを追加する必要があります。

于 2012-10-28T10:32:29.443 に答える
1

サブクエリを使用して、表示するデータを制限します。

select cme_fbid 
from (select * from table1 order by someThing limit 1000) x
where someField = someValue
于 2012-10-28T10:37:12.393 に答える
0

select count(*) as cnt from table1 where cme_fbid is not null and cme_fbid <> 0 limit 1000 order by id

またはで使用mysql_row_countする

select cme_fbid from table1 where cme_fbid is not null and cme_fbid <> 0 limit 1000 order by id

于 2012-10-28T10:23:17.710 に答える