postgres
where hoge like '%\xc2\xa0%' ついでにrubyでnbsp削除は .gsub(/[\u00A0]/, ' ')
前提条件:capybaraが使える状態(参考) まずphantomjsをインストールします。(参考ページ) cd /usr/local/share sudo wget https://phantomjs.googlecode.com/files/phantomjs-1.9.0-linux-x86_64.tar.bz2 sudo tar xjf phantomjs-1.9.0-linux-x86_64.ta…
update machines set ip = replace(ip, '192.168.0', '192.168.3') これでmachinesテーブルのipカラムの「192.168.0」が「192.168.3」に置き換わります。
= の代わりに ~ を使います。 例 where tel ~ '^\d+-\d+-\d+$' これで電話番号の後ろにキャプション等が付いていないレコードのみ抽出できます。