Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个动物收容所的数据库。我想创建一个视图来显示从赞助、捐赠表等中的记录创建的收入/结果。
所以我需要选择所有捐赠行并将它们包含在我的视图中。我还想创建一个虚拟行并用“捐赠”填充它,以显示所有这些行都是捐赠,赞助等也是如此。
有没有办法在 MySQL 中做到这一点?
SELECT name, 'value_to_populate' AS 'virtual_column' FROM table