Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
皆さんこんにちは
たとえば、単純なphp配列があります。
$numbers=array("12345","65432","98765");
SQLテーブルの名前: "phones"、列"TNumbers"、行: 654654、12345、87878。
では、SQL サーバー テーブルに存在する配列からすべての値を返す最速の方法は何でしょうか? (したがって、これのみを返す必要があります: ("12345"))
どうもありがとうございます!!
さらに検索した後、答えが見つかりました。申し訳ありません。
$ids = join(',',$numbers); $sql = "SELECT * FROM phones WHERE TNumbers IN ($ids)";
ともあれ、ありがとう!