AW: View ändert type??
Hallo,
ich wollte es eher abstrakt halten, aber wenns dem verständis dient hier die konkreten statments:
CREATE VIEW fdata (fid ,fref,fstart,fstop,fbin,ftypeid,fscore,fstrand,fphase,gid,ftarget_star t,ftarget_stop)
AS
SELECT annotation.annotation_id, genomic_string.short_name,start,end , 0,type,0, strand,phase, annotation.annotation_id, 0,0
FROM annotation join term join entry_has_annotation join entry join entry_has_sequence join genomic_string
WHERE
entry.entry_id=entry_has_annotation.entry_id and entry_has_annotation.annotation_id=annotation.annotation_id and term.id=annotation.type AND entry.entry_id=entry_has_sequence.entry_id and entry_has_sequence.sequence_id=genomic_string.sequence_id
UNION
Select fid ,fref,fstart,fstop,fbin,ftypeid,fscore,fstrand,fphase,gid,ftarget_star t,ftarget_stop
from fdata_help
Typen:
für result aus select:
annotation.annotation_id (INT(10),
genomic_string.short_name Varchar(100),
start (INT(10)),end(INT(10)) ,
type(INT(10)),
strand(enum('+','-')),
phase(enum( '0','1','2')),
annotation.annotation_id(INT(10))
für fdata_help:
`fid` int(11) NOT NULL auto_increment,
`fref` varchar(100) collate latin1_general_ci NOT NULL,
`fstart` int(11) NOT NULL,
`fstop` int(11) NOT NULL,
`fbin` double default NULL,
`ftypeid` int(11) NOT NULL,
`fscore` float default NULL,
`fstrand` enum('+','-') collate latin1_general_ci default NULL,
`fphase` enum('0','1','2') collate latin1_general_ci default NULL,
`gid` int(11) NOT NULL,
`ftarget_start` int(11) default NULL,
`ftarget_stop` int(11) default NULL,
Wenn ich den View nur über das select mache bzw. nur über fdata_help, dann bleibt enum korrekt. Nur wenn ich beide einbinde über UNION wird aus enum varchar(1). Ich brauch aber enum.
Gruss mara
|