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.
メールアドレスと通常のユーザー名を持つmysql dbテーブルに列があります。
各行から「@domain.com」を削除できるクエリを実行する必要がありますが、それが電子メールの場合は残りを保持します。
どうすればいいのかわからない。
substring を使用するのはどうですか?
SELECT SUBSTRING_INDEX('www.mysql.com', '.', 2); returns: 'www.mysql'