如果存在如下数据表: 
A          B               
1         qq 
1         ww 
输出:
A          B               
1qq       qq
1ww       ww

解决方案 »

  1.   

    selet CONCAT(A, B),B
    from 数据表[align=center]====  ====
    [/align]
      

  2.   

    以下摘自 MySQL 5.1 Reference ManualCONCAT(str1,str2,...) 

    Returns the string that results from concatenating the arguments. May have one or more arguments. If all arguments are non-binary strings, the result is a non-binary string. If the arguments include any binary strings, the result is a binary string. A numeric argument is converted to its equivalent binary string form; if you want to avoid that, you can use an explicit type cast, as in this example: SELECT CONCAT(CAST(int_col AS CHAR), char_col);CONCAT() returns NULL if any argument is NULL. mysql> SELECT CONCAT('My', 'S', 'QL');
            -> 'MySQL'
    mysql> SELECT CONCAT('My', NULL, 'QL');
            -> NULL
    mysql> SELECT CONCAT(14.3);
            -> '14.3'[align=center]====  ====
    [/align]