0

例子:

SELECT
    (
        ...
    ) AS imageName,
    (
        ...
    ) AS imageURL,
    CONCAT(imageName, ' ', imageURL)

我怎么能做到这一点?

4

2 回答 2

1

您可以执行以下操作,但要注意表的别名:

   SELECT
     T.imageName, T.imageURL
     CONCAT(imageName, ' ', imageURL)
   FROM 
   (
       SELECT
      (
        ...
       ) AS imageName,
       (
        ...
      ) AS imageURL
       FROM ... AS innerT
   ) T
于 2012-09-26T14:13:35.493 回答
1

您可以在 CONCAT 中完成所有操作,如下所示:

select CONCAT(( select ... ), ' ', ( select ... )) 
于 2012-09-26T14:14:08.003 回答