This repository has been archived by the owner on Aug 23, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
index.html
56 lines (47 loc) · 1.38 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="../../js/codemirror.js" type="text/javascript"></script>
<title>CodeMirror: SQL demonstration</title>
<link rel="stylesheet" type="text/css" href="../../css/docs.css"/>
</head>
<body style="padding: 20px;">
<p>Demonstration of <a href="../../index.html">CodeMirror</a>'s SQL
highlighter.</p>
<p>Written by John Benediktsson (<a href="LICENSE">license</a>).</p>
<div style="border-top: 1px solid black; border-bottom: 1px solid black;">
<textarea id="code" cols="120" rows="50">
create table if not exists table1(
a bigint(13) not null primary key,
b char(4) not null,
c char(50) not null,
d int(9) not null,
);
insert into table1 values (1234567890123, "b", "c", 0);
select from_unixtime(a/1000), b, c, min(d) as `using`
from table1 t1
left join table2 t2 using (a)
-- inner join table3 t3 on t3._a = t1.a
join (
select a, b, c
from data
) as foo on foo.a = t1.a
where a > 10
and b like '%foo'
or c = 3.14159
and d < -15.7
order by 1 desc
;
select @total := sum(d) from data;
</textarea>
</div>
<script type="text/javascript">
var editor = CodeMirror.fromTextArea('code', {
height: "450px",
parserfile: "../contrib/sql/js/parsesql.js",
stylesheet: "css/sqlcolors.css",
path: "../../js/",
textWrapping: false
});
</script>
</body>
</html>