跟检索字符串一样,可用
select * from tablename where textname like '检索词';
即可,也可以用%等。

解决方案 »

  1.   

    我这里怎么提示:检索词不是column。能再说的详细一点吗?
      

  2.   

    test=# select aa from t1 where dd like '%我%';
    ERROR:  operator does not exist: text[] ~~ "unknown"
    提示:  No operator matches the given name and argument type(s). You may need to
    add explicit type casts.
      

  3.   

    解决了,原来text字段属于数组查询,得dd[1]这样来弄
      

  4.   

    可是我又遇到了新问题:
    test=# select * from t1 where dd[1] like '可以';
    ERROR:  invalid byte sequence for encoding "UNICODE": 0xd4
    test=# select * from t1 where dd[1] like '我';
     aa | bb | cc | dd
    ----+----+----+----
    (0 行)
    这是为啥啊?该怎么解决?解决了马上散分!!!
      

  5.   

    text和varchar没区别的,只不过是变长而已。查询和varchar没什么两样。
    我的pgsql就没什么问题。不过我的数据库编码是EUC_CN.
      

  6.   

    那我的这个怎么回事?我采用的是postgresql默认的啊  为啥有的汉字就没问题呢?bug?
      

  7.   

    dutzhp(void) 楼主,我现在不懂,刚在学.帮你顶一下,能不能帮我看看我的问题怎么解决,我有发贴
      

  8.   

    是客户端编码的原因,
    test=# \encoding GBK
    运行一下看看