aglo / MySQLParser

A Parser for MySQL's SQL.
3 stars 6 forks source link

TableNames Finder not supported by JSqlParser #6

Open wenzong opened 11 years ago

wenzong commented 11 years ago

SELECT

Select 1;
select unix_timestamp(now()) - (select unix_timestamp(ts) 
    from heartbeat order by id desc limit 1)
SELECT @@session.autocommit

DELETE

delete table1,table2

SET

SET NAMES utf8

SHOW

SHOW COLLATION

COMMIT

commit

其他关键字

SELECT
    IFNULL((SELECT SUM(clicks_nb) FROM ajk_proclicklog_monthly 
        WHERE period = a.last_month AND brokerid = 1077555), 0) 
        AS PmontClick,
    IFNULL((SELECT SUM(clicks_nb) FROM ajk_proclicklog_monthly 
        WHERE period = a.this_month AND brokerid = 1077555), 0) 
        AS MonthClick,
    IFNULL((SELECT SUM(clicks_nb) FROM ajk_proclicklog_daily 
        WHERE period = a.yesterday AND brokerid = 1077555), 0) 
        AS YesteClick,
    IFNULL((SELECT SUM(clicks_nb) FROM ajk_proclicklog_daily 
        WHERE period = a.today AND brokerid = 1077555), 0) 
        AS TodayClick
FROM
    (SELECT
        EXTRACT(YEAR_MONTH FROM DATE_SUB(CURDATE(), 
            INTERVAL 1 MONTH)) AS last_month,
        EXTRACT(YEAR_MONTH FROM CURDATE()) 
            AS this_month,
        EXTRACT(YEAR_MONTH FROM 
           DATE_SUB (CURDATE(), INTERVAL 1 DAY)) * 100 + 
            extract(DAY FROM DATE_SUB(CURDATE(), INTERVAL 1 DAY))
            AS yesterday,
        EXTRACT(YEAR_MONTH FROM CURDATE()) * 100 
            + extract(DAY FROM CURDATE()) AS today
    ) a
insert into list_acenter_hetong_c (contractId,httype,sub_amount) 
    values ('E03KM1303120001','6','0.70')  
    ON DUPLICATE KEY UPDATE 
    contractId='E03KM1303120001',
    httype='6',sub_amount=sub_amount+0.70 
    #v2:CoSB_vc@CoSB_vc.php (490) stats_db 1368285213

MORE