标签: mysql select
有没有办法在SELECT语句的整数列中添加1?类似的东西:
$result = mysql_query('SELECT (counter + 1) from table...
感谢。
答案 0 :(得分:1)
SELECT (counter + 1) AS counter FROM table;
请务必指定列别名(AS counter),否则将更难使用mysql_fetch_assoc()
(AS counter)
mysql_fetch_assoc()