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.
条件に基づいて、Oracle データベースから 2 つのレコードをスプールしたいと考えています。つまり、名前、住所、SIN 番号、言語 (英語またはフランス語) のフィールドを持つ 1000 のレコードがあることを意味します。英語とフランス語の 2 つのレコードをスプールしたいと考えています。1 つのレコードが英語で、もう 1 つのレコードがフランス語のレコードである 2 つのレコードをランダムに選択する方法はありますか?
これが行うのと同じくらい簡単です:
select rownum, lang, name from t where lang = 'french' union all select rownum, lang, name from t where lang = 'english' order by 1,2
SQL フィドル