1
1
DROP TABLE IF EXISTS t1;
3
cont_nr int(11) NOT NULL auto_increment,
4
ver_nr int(11) NOT NULL default '0',
5
aufnr int(11) NOT NULL default '0',
3
cont_nr int NOT NULL auto_increment,
4
ver_nr int NOT NULL default '0',
5
aufnr int NOT NULL default '0',
6
6
username varchar(50) NOT NULL default '',
7
hdl_nr int(11) NOT NULL default '0',
7
hdl_nr int NOT NULL default '0',
8
8
eintrag date NOT NULL default '0000-00-00',
9
9
st_klasse varchar(40) NOT NULL default '',
10
10
st_wert varchar(40) NOT NULL default '',
11
11
st_zusatz varchar(40) NOT NULL default '',
12
12
st_bemerkung varchar(255) NOT NULL default '',
13
13
kunden_art varchar(40) NOT NULL default '',
14
mcbs_knr int(11) default NULL,
15
mcbs_aufnr int(11) NOT NULL default '0',
14
mcbs_knr int default NULL,
15
mcbs_aufnr int NOT NULL default '0',
16
16
schufa_status char(1) default '?',
19
wf_igz int(11) NOT NULL default '0',
19
wf_igz int NOT NULL default '0',
20
20
tarifcode varchar(80) default NULL,
21
21
recycle char(1) default NULL,
22
22
sim varchar(30) default NULL,
23
23
mcbs_tpl varchar(30) default NULL,
24
emp_nr int(11) NOT NULL default '0',
25
laufzeit int(11) default NULL,
24
emp_nr int NOT NULL default '0',
25
laufzeit int default NULL,
26
26
hdl_name varchar(30) default NULL,
27
prov_hdl_nr int(11) NOT NULL default '0',
27
prov_hdl_nr int NOT NULL default '0',
28
28
auto_wirknetz varchar(50) default NULL,
29
29
auto_billing varchar(50) default NULL,
30
30
touch timestamp NOT NULL,
48
48
KEY kundentyp(kundentyp),
49
49
KEY p_nr(p_nr,suffix)
51
INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und gepr�ft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
52
INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und gepr�ft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
53
INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und gepr�ft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
54
INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und gepr�ft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
55
INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und gepr�ft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007');
56
INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. m�chte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
57
INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und gepr�ft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
51
INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto','2001-02-02 10:59:16','Mobilfunk','PP','','','');
52
INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
53
INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
54
INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
55
INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007');
56
INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. mchte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
57
INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
58
58
SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie;
59
59
Kundentyp kategorie
60
60
Privat (Private Nutzung) Mobilfunk
81
81
insert into t1 values(11,22,33);
82
82
insert into t2 values(99);
83
83
select t1.* as 'with_alias' from t1;
84
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias' from t1' at line 1
84
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias' from t1' at line 1
85
85
select t2.* as 'with_alias' from t2;
86
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias' from t2' at line 1
86
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias' from t2' at line 1
87
87
select t1.*, t1.* as 'with_alias' from t1;
88
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias' from t1' at line 1
88
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias' from t1' at line 1
89
89
select t1.* as 'with_alias', t1.* from t1;
90
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias', t1.* from t1' at line 1
90
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias', t1.* from t1' at line 1
91
91
select t1.* as 'with_alias', t1.* as 'alias2' from t1;
92
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias', t1.* as 'alias2' from t1' at line 1
92
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias', t1.* as 'alias2' from t1' at line 1
93
93
select t1.* as 'with_alias', a, t1.* as 'alias2' from t1;
94
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias', a, t1.* as 'alias2' from t1' at line 1
94
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias', a, t1.* as 'alias2' from t1' at line 1
95
95
select a, t1.* as 'with_alias' from t1;
96
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias' from t1' at line 1
96
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias' from t1' at line 1
97
97
select t1.* as 'with_alias', a from t1;
98
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias', a from t1' at line 1
98
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias', a from t1' at line 1
99
99
select a, t1.* as 'with_alias', b from t1;
100
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias', b from t1' at line 1
100
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias', b from t1' at line 1
101
101
select (select d from t2 where d > a), t1.* as 'with_alias' from t1;
102
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias' from t1' at line 1
102
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias' from t1' at line 1
103
103
select t1.* as 'with_alias', (select a from t2 where d > a) from t1;
104
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias', (select a from t2 where d > a) from t1' at line 1
104
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias', (select a from t2 where d > a) from t1' at line 1
105
105
select a as 'x', t1.* as 'with_alias' from t1;
106
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias' from t1' at line 1
106
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias' from t1' at line 1
107
107
select t1.* as 'with_alias', a as 'x' from t1;
108
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias', a as 'x' from t1' at line 1
108
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias', a as 'x' from t1' at line 1
109
109
select a as 'x', t1.* as 'with_alias', b as 'x' from t1;
110
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias', b as 'x' from t1' at line 1
110
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias', b as 'x' from t1' at line 1
111
111
select (select d from t2 where d > a) as 'x', t1.* as 'with_alias' from t1;
112
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias' from t1' at line 1
112
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias' from t1' at line 1
113
113
select t1.* as 'with_alias', (select a from t2 where d > a) as 'x' from t1;
114
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias', (select a from t2 where d > a) as 'x' from t1' at line 1
114
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias', (select a from t2 where d > a) as 'x' from t1' at line 1
115
115
select (select t2.* as 'x' from t2) from t1;
116
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'x' from t2) from t1' at line 1
116
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'x' from t2) from t1' at line 1
117
117
select a, (select t2.* as 'x' from t2) from t1;
118
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'x' from t2) from t1' at line 1
118
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'x' from t2) from t1' at line 1
119
119
select t1.*, (select t2.* as 'x' from t2) from t1;
120
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'x' from t2) from t1' at line 1
120
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'x' from t2) from t1' at line 1
121
121
insert into t3 select t1.* as 'with_alias' from t1;
122
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias' from t1' at line 1
122
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias' from t1' at line 1
123
123
insert into t3 select t2.* as 'with_alias', 1, 2 from t2;
124
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias', 1, 2 from t2' at line 1
124
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias', 1, 2 from t2' at line 1
125
125
insert into t3 select t2.* as 'with_alias', d as 'x', d as 'z' from t2;
126
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias', d as 'x', d as 'z' from t2' at line 1
126
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias', d as 'x', d as 'z' from t2' at line 1
127
127
insert into t3 select t2.*, t2.* as 'with_alias', 3 from t2;
128
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias', 3 from t2' at line 1
128
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias', 3 from t2' at line 1
129
129
create table t3 select t1.* as 'with_alias' from t1;
130
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias' from t1' at line 1
130
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias' from t1' at line 1
131
131
create table t3 select t2.* as 'with_alias', 1, 2 from t2;
132
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias', 1, 2 from t2' at line 1
132
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias', 1, 2 from t2' at line 1
133
133
create table t3 select t2.* as 'with_alias', d as 'x', d as 'z' from t2;
134
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias', d as 'x', d as 'z' from t2' at line 1
134
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias', d as 'x', d as 'z' from t2' at line 1
135
135
create table t3 select t2.*, t2.* as 'with_alias', 3 from t2;
136
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as 'with_alias', 3 from t2' at line 1
144
select t1.*, t1.* from t1;
148
select t1.*, a, t1.* from t1;
152
select a, t1.* from t1;
156
select t1.*, a from t1;
160
select a, t1.*, b from t1;
164
select (select d from t2 where d > a), t1.* from t1;
165
(select d from t2 where d > a) a b c
168
select t1.*, (select a from t2 where d > a) from t1;
169
a b c (select a from t2 where d > a)
172
select a as 'x', t1.* from t1;
176
select t1.*, a as 'x' from t1;
180
select a as 'x', t1.*, b as 'x' from t1;
184
select (select d from t2 where d > a) as 'x', t1.* from t1;
188
select t1.*, (select a from t2 where d > a) as 'x' from t1;
192
select (select t2.* from t2) from t1;
193
(select t2.* from t2)
196
select a, (select t2.* from t2) from t1;
197
a (select t2.* from t2)
200
select t1.*, (select t2.* from t2) from t1;
201
a b c (select t2.* from t2)
204
insert into t3 select t1.* from t1;
205
insert into t3 select t2.*, 1, 2 from t2;
206
insert into t3 select t2.*, d as 'x', d as 'z' from t2;
207
insert into t3 select t2.*, t2.*, 3 from t2;
208
create table t4 select t1.* from t1;
210
create table t4 select t2.*, 1, 2 from t2;
212
create table t4 select t2.*, d as 'x', d as 'z' from t2;
136
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'as 'with_alias', 3 from t2' at line 1
214
137
drop table t1,t2,t3;