[英]more columns with select
The question is a little crazy. 这个问题有点疯狂。 I have a table in MySQL with columns 'id', 'from' and 'to'.
我在MySQL中有一个带有“ id”,“ from”和“ to”列的表。 I want the select to perform on this table and I need more columns for subsequent tasks.
我希望选择在此表上执行,并且我需要更多列用于后续任务。
An example: 一个例子:
DROP TEMPORARY TABLE IF EXISTS bla;
CREATE TEMPORARY TABLE bla (SELECT *, (SELECT id) AS test FROM flug WHERE flug_id >= 1 AND flug_id < 11);
UPDATE bla SET test = 100000;
SELECT flug_id, test FROM bla;
Are there other ways to create further columns? 还有其他方法可以创建更多列吗?
With best regards 最诚挚的问候
Stephan 斯蒂芬
Couldn't you just do? 你不能做吗?
SELECT flug_id, 100000 as test
FROM flug as f
WHERE flug_id >= 1
AND flug_id < 11;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.