Hi,
why do I get the following error:

"* -108: Table or index dropped or content deleted SQLSTATE: I0108"

while trying the following query

TIA,
Bruno @ ic3s.de

select
tsday ,
max(case when application =  'tableA' then  cnt       end ) "cnt A",
max(case when application =  'tableA' then  "columnA" end ) "AcolumnA",
max(case when application =  'tableA' then  "columnB" end ) "AcolumnB",
max(case when application =  'tableB' then  cnt       end ) "cnt B",
max(case when application =  'tableB' then  "columnA" end ) "BcolumnA",
max(case when application =  'tableB' then  "columnB" end ) "BcolumnB",
max(case when application =  'tableC' then  cnt       end ) "cnt C",
max(case when application =  'tableC' then  "columnA" end ) "CcolumnA",
max(case when application =  'tableC' then  "columnB" end ) "CcolumnB"
from
(
select tsday, 'tableA'  application, count(*) cnt,
count(distinct columnA) "columnA",
count(distinct columnB) "columnB"
from tableA
group by tsday
union all
select tsday, 'tableB'  application, count(*) cnt,
count(distinct columnA) "columnA",
count(distinct columnB) "columnB"
from tableB
group by tsday
union all
select tsday, 'tableC'  application, count(*) cnt,
count(distinct columnA) "columnA",
count(distinct columnB) "columnB"
from tableC
group by tsday
)
group by tsday
order by 1 asc
//

The tables are defined as:

CREATE TABLE tableA
(
  tsday  CHAR(8)   NOT NULL,
  columnA CHAR(16)  NOT NULL,
  columnB CHAR(16)  NOT NULL
)
//
CREATE TABLE tableB
(
  tsday  CHAR(8)   NOT NULL,
  columnA CHAR(16)  NOT NULL,
  columnB CHAR(16)  NOT NULL
)
//
CREATE TABLE tableC
(
  tsday  CHAR(8)   NOT NULL,
  columnA CHAR(16)  NOT NULL,
  columnB CHAR(16)  NOT NULL
)
//
INSERT INTO tableA values('200411', 'A1', 'B1')
//
INSERT INTO tableA values('200411', 'A2', 'B2')
//
INSERT INTO tableB values('200411', 'A1', 'B1')
//
INSERT INTO tableB values('200411', 'A2', 'B2')
//
INSERT INTO tableC values('200411', 'A1', 'B1')
//
INSERT INTO tableC values('200411', 'A2', 'B2')
//

-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to