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)