vendor/jdorn/sql-formatter/examples/examples.php

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<!DOCTYPE html>
<html>
<head>
    <title>SqlFormatter Examples</title>
    <style>
        body {
            font-family: arial;
        }

        table, td, th {
            border: 1px solid #aaa;
        }

        table {
            border-width: 1px 1px 0 0;
            border-spacing: 0;
        }

        td, th {
            border-width: 0 0 1px 1px;
            padding: 5px 10px;
            vertical-align: top;
        }

        pre {
            padding: 0;
            margin: 0;
        }
    </style>
</head>
<body>
<?php

require_once(__DIR__.'/../lib/SqlFormatter.php');

// Example statements for formatting and highlighting
$statements = array(
    "SELECT DATE_FORMAT(b.t_create, '%Y-%c-%d') dateID, b.title memo 
    FROM (SELECT id FROM orc_scheme_detail d WHERE d.business=208 
    AND d.type IN (29,30,31,321,33,34,3542,361,327,38,39,40,41,42,431,4422,415,4546,47,48,'a',
    29,30,31,321,33,34,3542,361,327,38,39,40,41,42,431,4422,415,4546,47,48,'a') 
    AND d.title IS NOT NULL AND t_create >= 
    DATE_FORMAT((DATE_SUB(NOW(),INTERVAL 1 DAY)),'%Y-%c-%d') AND t_create 
    < DATE_FORMAT(NOW(), '%Y-%c-%d') ORDER BY d.id LIMIT 2,10) a, 
    orc_scheme_detail b WHERE a.id = b.id",
    
    "SELECT * from Table1 LEFT 
    OUTER JOIN Table2 on Table1.id = Table2.id",
    
    "SELECT * FROM MyTable WHERE id = 46",

    "SELECT count(*),`Column1` as count,`Testing`, `Testing Three` FROM `Table1`
    WHERE Column1 = 'testing' AND ( (`Column2` = `Column3` OR Column4 >= NOW()) )
    GROUP BY Column1 ORDER BY Column3 DESC LIMIT 5,10",

    "select * from `Table`, (SELECT group_concat(column1) as col FROM Table2 GROUP BY category)
    Table2, Table3 where Table2.col = (Table3.col2 - `Table`.id)",

    "insert ignore into Table3 (column1, column2) VALUES ('test1','test2'), ('test3','test4');",

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。