0

I have

select * from table where id = 3;

but I would like to also make a transformation on one column, so something like this:

select replace(aaa, 'a', 'b'), * from table where id = 3;

but this does not work. Anybody knows ?

4

2 回答 2

2

原因是因为asterisk *在替换操作之后,尝试交换它,它会正常工作,

select  *, 
        replace(aaa, 'a', 'b')  
from    `table` 
where   id = 3;
于 2013-03-03T11:49:10.100 回答
2

This should work:

select replace(aaa, 'a', 'b'), t.* from table t where id = 3;
于 2013-03-03T11:54:02.580 回答