プロが教えるわが家の防犯対策術!

http://oshiete.goo.ne.jp/qa/1599858.html

この質問に疑問があります。

回答2で
where (column1 || '/' || column2 ||'/' || column3) like '%word1%' ;

というアドバイスに対して質問者は

where ( concat( column1 , column2 , column3) like '%word1%' )

でできたと返しています。
なぜ、質問者はwhere ( concat( column1 , column2 , column3) like '%word1%' )
というSQL文にいたったのでしょうか?
where ( concat( column1 , column2 , column3) like '%word1%' )
では、だめだったのでしょうか?

A 回答 (1件)

パイプ(||)で文字連結をするには事前の設定が必要です。


http://db.just4fun.biz/MySQL/MySQL%E3%81%A7%E3%8 …

事前の設定なしで文字連結を実現できるという理由でconcat関数を使ったのではないでしょうか。
    • good
    • 0
この回答へのお礼

なるほどー
僕も実行したらEmpty set, 13 warningsが返ってきてしまってなんだろ?っと思ってました。ありがとうございます。

お礼日時:2013/06/08 14:33

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!

関連するカテゴリからQ&Aを探す