在函数和别名处理上还有些问题,但比上一版已经好一些了。现在单句多句都能整形了。
1原始的Sql为:
2select ( * ) from dual
3解析后的的Sql为:
4select
5 (
6 *
7 )
8from
9 dual
10
11原始的Sql为:
12SELECT * frOm dual
13解析后的的Sql为:
14SELECT
15 *
16frOm
17 dual
18
19原始的Sql为:
20Select C1,c2 From tb
21解析后的的Sql为:
22Select
23 C1,
24 c2
25From
26 tb
27
28原始的Sql为:
29selecT c1,c2 from tb
30解析后的的Sql为:
31selecT
32 c1,
33 c2
34from
35 tb
36
37原始的Sql为:
38select count(*) from t1
39解析后的的Sql为:
40select
41 count
42 (
43 *
44 )
45from
46 t1
47
48原始的Sql为:
49select c1,c2,c3 from t1 where condi1=1
50解析后的的Sql为:
51select
52 c1,
53 c2,
54 c3
55from
56 t1
57where
58 condi1=1
59
60原始的Sql为:
61Select c1,c2,c3 From t1 Where condi1=1
62解析后的的Sql为:
63Select
64 c1,
65 c2,
66 c3
67From
68 t1
69Where
70 condi1=1
71
72原始的Sql为:
73select c1,c2,c3 from t1,t2 where ( condi3=3 or condi4=5 ) order by o1,o2
74解析后的的Sql为:
75select
76 c1,
77 c2,
78 c3
79from
80 t1,
81 t2
82where
83 (
84 condi3=3
85 or
86 condi4=5
87 )
88order by
89 o1,
90 o2
91
92原始的Sql为:
93select f1,(select f2 from t01) from t02 where 1=1
94解析后的的Sql为:
95select
96 f1,
97 (
98 select
99 f2
100 from
101 t01
102 )
103from
104 t02
105where
106 1=1
107
108原始的Sql为:
109select f1,( select a from b ) from ( select f1,f2 from ( select f1,f2,f3 from tb ) ),t4 where 1=1
110解析后的的Sql为:
111select
112 f1,
113 (
114 select
115 a
116 from
117 b
118 )
119from
120 (
121 select
122 f1,
123 f2
124 from
125 (
126 select
127 f1,
128 f2,
129 f3
130 from
131 tb
132 )
133 )
134 ,
135 t4
136where
137 1=1
138
139原始的Sql为:
140select f1,( select * from tb2,( select * from ( select * from ( select * from tb5 ) ) ) ) from tabl1 where 1=1
141解析后的的Sql为:
142select
143 f1,
144 (
145 select
146 *
147 from
148 tb2,
149 (
150 select
151 *
152 from
153 (
154 select
155 *
156 from
157 (
158 select
159 *
160 from
161 tb5
162 )
163 )
164 )
165 )
166from
167 tabl1
168where
169 1=1
170
171原始的Sql为:
172
173解析后的的Sql为:
174
175原始的Sql为:
176Select c1 1,c2,c3 from t1 3,t2 4 Where condi3=3 and condi4=5 Order by o1,o2
177解析后的的Sql为:
178Select
179 c1
180 1,
181 c2,
182 c3
183from
184 t1
185 3,
186 t2
187 4
188Where
189 condi3=3
190 and
191 condi4=5
192Order by
193 o1,
194 o2
195
196原始的Sql为:
197select c1,c2,c3 from t1,t2, t3 where condi1=5 and condi6=6 or condi7=7 group by g1,g2
198解析后的的Sql为:
199select
200 c1,
201 c2,
202 c3
203from
204 t1,
205 t2,
206 t3
207where
208 condi1=5
209 and
210 condi6=6
211 or
212 condi7=7
213group by
214 g1,
215 g2
216
217原始的Sql为:
218Select c1,c2,c3 From t1,t2,t3 Where condi1=5 and condi6=6 or condi7=7 Group by g1,g2
219解析后的的Sql为:
220Select
221 c1,
222 c2,
223 c3
224From
225 t1,
226 t2,
227 t3
228Where
229 condi1=5
230 and
231 condi6=6
232 or
233 condi7=7
234Group by
235 g1,
236 g2
237
238原始的Sql为:
239Select c1,c2,c3 From t1,t2,t3 Where condi1=5 and ( condi6=6 or condi7=7 ) Group by g1,g2,g3 order by g2,g3
240解析后的的Sql为:
241Select
242 c1,
243 c2,
244 c3
245From
246 t1,
247 t2,
248 t3
249Where
250 condi1=5
251 and
252 (
253 condi6=6
254 or
255 condi7=7
256 )
257Group by
258 g1,
259 g2,
260 g3
261order by
262 g2,
263 g3
264
265原始的Sql为:
266select c1,c2,c3 from t1 left join t2 on condi3=3 or condi4=5 order by o1,o2
267解析后的的Sql为:
268select
269 c1,
270 c2,
271 c3
272from
273 t1
274left join
275 t2
276on
277 condi3=3
278 or
279 condi4=5
280order by
281 o1,
282 o2
283
284原始的Sql为:
285select c1,c2,c3 from t1 right join t2 on condi3=3 or condi4=5 order by o1,o2
286解析后的的Sql为:
287select
288 c1,
289 c2,
290 c3
291from
292 t1
293right join
294 t2
295on
296 condi3=3
297 or
298 condi4=5
299order by
300 o1,
301 o2
302
303原始的Sql为:
304select c1,c2,c3 from t1 inner join t2 on condi3=3 or condi4=5 order by o1,o2
305解析后的的Sql为:
306select
307 c1,
308 c2,
309 c3
310from
311 t1
312inner join
313 t2
314on
315 condi3=3
316 or
317 condi4=5
318order by
319 o1,
320 o2
321
322原始的Sql为:
323select c1,c2,c3 from t1 left join t2 having condi3=3 or condi4=5 group by g1,g3,g5 order by o1,o2
324解析后的的Sql为:
325select
326 c1,
327 c2,
328 c3
329from
330 t1
331left join
332 t2
333having
334 condi3=3
335 or
336 condi4=5
337group by
338 g1,
339 g3,
340 g5
341order by
342 o1,
343 o2
344
345原始的Sql为:
346delete from table
347解析后的的Sql为:
348deletefrom
349 table
350
351原始的Sql为:
352delete from table where 1=1
353解析后的的Sql为:
354deletefrom
355 table
356where
357 1=1
358
359原始的Sql为:
360delete from table where c1=1 and c2=2 or c3=3
361解析后的的Sql为:
362deletefrom
363 table
364where
365 c1=1
366 and
367 c2=2
368 or
369 c3=3
370
371原始的Sql为:
372update checktable set ID='' where 1=1
373解析后的的Sql为:
374update
375 checktable
376set
377 ID=''
378where
379 1=1
380
381原始的Sql为:
382update checktable set ID='', NAME='' where 1=1 and 2=2
383解析后的的Sql为:
384update
385 checktable
386set
387 ID='',
388 NAME=''
389where
390 1=1
391 and
392 2=2
393
394原始的Sql为:
395update checktable set ID='', NAME='', count='', remark='' where 1=1 and 2=2 or 3=3
396解析后的的Sql为:
397update
398 checktable
399set
400 ID='',
401 NAME='',
402 count='',
403 remark=''
404where
405 1=1
406 and
407 2=2
408 or
409 3=3
410
411原始的Sql为:
412 insert into checktable ( ID ) values ( '1' )
413解析后的的Sql为:
414insert into
415 checktable
416 (
417 ID
418 )
419values
420 (
421 '1'
422 )
423
424原始的Sql为:
425 insert into checktable ( ID,r ) values ( '1','' )
426解析后的的Sql为:
427insert into
428 checktable
429 (
430 ID,
431 r
432 )
433values
434 (
435 '1',
436 ''
437 )
438
439原始的Sql为:
440 insert into checktable ( ID, NAME, count, remark ) values ( '1', '2', '3', '4' )
441解析后的的Sql为:
442insert into
443 checktable
444 (
445 ID,
446 NAME,
447 count,
448 remark
449 )
450values
451 (
452 '1',
453 '2',
454 '3',
455 '4'
456 )
457
458原始的Sql为:
459insert into checktable select c1,c2,c3 from t1 where condi1=1
460解析后的的Sql为:
461insert into
462 checktable
463select
464 c1,
465 c2,
466 c3
467from
468 t1
469where
470 condi1=1
471
472原始的Sql为:
473insert into checktable Select c1,c2,c3 From t1 Where condi1=1
474解析后的的Sql为:
475insert into
476 checktable
477Select
478 c1,
479 c2,
480 c3
481From
482 t1
483Where
484 condi1=1
485
486原始的Sql为:
487insert into checktable select c1,c2,c3 from t1,t2 where condi3=3 or condi4=5 order by o1,o2
488解析后的的Sql为:
489insert into
490 checktable
491select
492 c1,
493 c2,
494 c3
495from
496 t1,
497 t2
498where
499 condi3=3
500 or
501 condi4=5
502order by
503 o1,
504 o2
505
506原始的Sql为:
507insert into checktable Select c1 1,c2,c3 from t1 3,t2 4 Where condi3=3 and condi4=5 Order by o1,o2
508解析后的的Sql为:
509insert into
510 checktable
511Select
512 c1
513 1,
514 c2,
515 c3
516from
517 t1
518 3,
519 t2
520 4
521Where
522 condi3=3
523 and
524 condi4=5
525Order by
526 o1,
527 o2
528
529原始的Sql为:
530insert into checktable select c1,c2,c3 from t1,t2, t3 where condi1=5 and condi6=6 or condi7=7 group by g1,g2
531解析后的的Sql为:
532insert into
533 checktable
534select
535 c1,
536 c2,
537 c3
538from
539 t1,
540 t2,
541 t3
542where
543 condi1=5
544 and
545 condi6=6
546 or
547 condi7=7
548group by
549 g1,
550 g2
551
552原始的Sql为:
553insert into checktable Select c1,c2,c3 From t1,t2,t3 Where condi1=5 and condi6=6 or condi7=7 Group by g1,g2
554解析后的的Sql为:
555insert into
556 checktable
557Select
558 c1,
559 c2,
560 c3
561From
562 t1,
563 t2,
564 t3
565Where
566 condi1=5
567 and
568 condi6=6
569 or
570 condi7=7
571Group by
572 g1,
573 g2
574
575原始的Sql为:
576insert into checktable Select c1,c2,c3 From t1,t2,t3 Where condi1=5 and condi6=6 or condi7=7 Group by g1,g2,g3 order by g2,g3
577解析后的的Sql为:
578insert into
579 checktable
580Select
581 c1,
582 c2,
583 c3
584From
585 t1,
586 t2,
587 t3
588Where
589 condi1=5
590 and
591 condi6=6
592 or
593 condi7=7
594Group by
595 g1,
596 g2,
597 g3
598order by
599 g2,
600 g3
601
602原始的Sql为:
603insert into checktable select c1,c2,c3 from t1 left join t2 on condi3=3 or condi4=5 order by o1,o2
604解析后的的Sql为:
605insert into
606 checktable
607select
608 c1,
609 c2,
610 c3
611from
612 t1
613left join
614 t2
615on
616 condi3=3
617 or
618 condi4=5
619order by
620 o1,
621 o2
622
623原始的Sql为:
624insert into checktable select c1,c2,c3 from t1 right join t2 on condi3=3 or condi4=5 order by o1,o2
625解析后的的Sql为:
626insert into
627 checktable
628select
629 c1,
630 c2,
631 c3
632from
633 t1
634right join
635 t2
636on
637 condi3=3
638 or
639 condi4=5
640order by
641 o1,
642 o2
643
644原始的Sql为:
645insert into checktable select c1,c2,c3 from t1 inner join t2 on condi3=3 or condi4=5 order by o1,o2
646解析后的的Sql为:
647insert into
648 checktable
649select
650 c1,
651 c2,
652 c3
653from
654 t1
655inner join
656 t2
657on
658 condi3=3
659 or
660 condi4=5
661order by
662 o1,
663 o2
664
665原始的Sql为:
666insert into checktable select c1,c2,c3 from t1 left join t2 having condi3=3 or condi4=5 group by g1,g3,g5 order by o1,o2
667解析后的的Sql为:
668insert into
669 checktable
670select
671 c1,
672 c2,
673 c3
674from
675 t1
676left join
677 t2
678having
679 condi3=3
680 or
681 condi4=5
682group by
683 g1,
684 g3,
685 g5
686order by
687 o1,
688 o2
689
690原始的Sql为:
691select (select * from dual) from dual
692解析后的的Sql为:
693select
694 (
695 select
696 *
697 from
698 dual
699 )
700from
701 dual
702
703原始的Sql为:
704select (*) from dual
705解析后的的Sql为:
706select
707 (
708 *
709 )
710from
711 dual
712
713原始的Sql为:
714select count(*) from dual
715解析后的的Sql为:
716select
717 count
718 (
719 *
720 )
721from
722 dual
723
724原始的Sql为:
725select id,name from (select id,name from (select id,name from customer) t1 ) t2
726解析后的的Sql为:
727select
728 id,
729 name
730from
731 (
732 select
733 id,
734 name
735 from
736 (
737 select
738 id,
739 name
740 from
741 customer
742 )
743 t1
744 )
745 t2
746
747
|