반응형
Recent Posts
Recent Comments
관리 메뉴

개발잡부

[Mysql] View 본문

Database

[Mysql] View

닉의네임 2022. 4. 1. 18:47
반응형
CREATE 
    ALGORITHM = UNDEFINED 
    DEFINER = `master`@`%` 
    SQL SECURITY DEFINER
VIEW `vw_ep_schedule_summary_info` AS
    SELECT 
        `a`.`pipe_id` AS `pipe_id`,
        `a`.`summary_url` AS `summary_url`,
        `a`.`mall_id` AS `mall_id`,
        `b`.`billing_type` AS `billing_type`,
        `b`.`mall_name` AS `mall_name`
    FROM
        (`mcps_interface_dev`.`ps_pipe_if` `a`
        JOIN `mcps_interface_dev`.`ps_mall_if` `b` ON ((`b`.`mall_id` = `a`.`mall_id`)))
    WHERE
        ((`b`.`mall_status` = 1)
            AND (`a`.`status` = 'Y')
            AND (`a`.`schedule_summary_hour` & POW(2,
                IF((CAST(LEFT(CURTIME(), 2) AS UNSIGNED) = 0),
                    24,
                    LEFT(CURTIME(), 2))))
            AND (`a`.`schedule_summary_min` = CAST(SUBSTR(CURTIME(), 4, 2) AS UNSIGNED)))
반응형

'Database' 카테고리의 다른 글

[mysql] left join 안에서 group_concat  (0) 2023.03.14
[mysql] PRIMARY KEY, UNIQUE KEY  (0) 2022.04.23
[Mysql] Procedure  (0) 2022.04.01
[MySql] Event Scheduler  (0) 2022.04.01
[MySql] Union Query  (0) 2022.03.15
Comments