Mysql 添加新列以供选择
我有下表
+-----+------------------+-------------+
| id | datenum | F1_baro_20_ |
+-----+------------------+-------------+
| 1 | 734152.000000000 | 1005.21 |
| 2 | 734152.006944445 | 1005.26 |
+-----+------------------+-------------+
当我做出选择时,我想再添加一列。
例如
SELECT id,datenum, F1_baro_20_ FROM test
我想添加一列,如下所示:
SELECT id,datenum, F1_baro_20_, new_column=1 FROM test
+-----+------------------+-------------+------------+
| id | datenum | F1_baro_20_ |new_column |
+-----+------------------+-------------+------------+
| 1 | 734152.000000000 | 1005.21 | 1 |
| 2 | 734152.006944445 | 1005.26 | 1 |
+-----+------------------+-------------+------------+
I have the following table
+-----+------------------+-------------+
| id | datenum | F1_baro_20_ |
+-----+------------------+-------------+
| 1 | 734152.000000000 | 1005.21 |
| 2 | 734152.006944445 | 1005.26 |
+-----+------------------+-------------+
When I make a selection I want to add one more column.
For example
SELECT id,datenum, F1_baro_20_ FROM test
And I want to add a column, something like this:
SELECT id,datenum, F1_baro_20_, new_column=1 FROM test
+-----+------------------+-------------+------------+
| id | datenum | F1_baro_20_ |new_column |
+-----+------------------+-------------+------------+
| 1 | 734152.000000000 | 1005.21 | 1 |
| 2 | 734152.006944445 | 1005.26 | 1 |
+-----+------------------+-------------+------------+
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这甚至适用于更复杂的表达式,如下所示:
This even works with more complex expressions, like this: