用户名
密码

MySQL数据库创建视图

Ezra
2021-03-16 / 0 评论 / 63 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2021年03月16日,已超过187天没有更新,若内容或图片失效,请留言反馈。
CREATE VIEW v_bill(id,name,money,paid_money,surplus_money,total_money,created_at,updated_at) AS SELECT bill.id,project.name,bill.money,bill.paid_money,bill.surplus_money,bill.total_money,bill.created_at,bill.updated_at FROM bill INNER JOIN project on bill.p_id =  project.id

SELECT
`bill`.`id` AS `id`,
`project`.`name` AS `name`,
`bill`.`money` AS `money`,
`bill`.`paid_money` AS `paid_money`,
`bill`.`surplus_money` AS `surplus_money`,
`bill`.`total_money` AS `total_money`,
`bill`.`created_at` AS `created_at`,
`bill`.`updated_at` AS `updated_at` FROM
( `bill` JOIN `project` ON ( ( `bill`.`p_id` = `project`.`id` ) ) )

使用Navicat里面的视图创建工具,非常方便

0

评论 (0)

取消