INNER JOIN topic ON topic.sort_id LIKE '%sort_sort.id%'这样写不对,因为 '%sort_sort.id%' 中的 sort_sort.id 变成了字符串INNER JOIN topic ON topic.sort_id LIKE '%"& sort_sort.id &"%'
而一般的这样写也不对,因为 sort_sort.id 没有赋予其变量名。应该怎么写呢????

解决方案 »

  1.   

    on 后面要跟=的
    on topic.sort_id = sort_sort.id 
      

  2.   

    那我现在只能用 like 来查询应该怎么弄呢?? instr 可以吗?
      

  3.   

    直接 
    from topic,sort_sort
    where rtrim(topic.sort_id) LIKE '%sort_sort.id%' 
      

  4.   

    INNER JOIN topic ON topic.sort_id LIKE '%'+ltrim(sort_sort.id)+'%' 
      

  5.   

    from topic join sort_sort
    on rtrim(topic.sort_id) LIKE '%sort_sort.id%' 
      

  6.   

    INNER JOIN topic ON LTRIM(topic.sort_id) LIKE '%'+ltrim(sort_sort.id)+'%' 如果5楼的不行,试试这样.
      

  7.   

    我按照5楼的答案成了,不加ltrim就出错,换成trim也出错,呵呵感谢各位帮助我的朋友,结贴