Hello,
On Tue, Oct 03, 2000 at 03:19:27PM +0100, Peter Hearty wrote:
> What version of InstantDB are you using?
3.21 but the database was created with 3.20beta2
> > SELECT * FROM Unit WHERE Unit.id IN (SELECT DISTINCT unitId FROM
> > UnitOptions WHERE fieldname="targetArea" AND value="Berlin")
> >
> > So... The above doesn't work...
> Do you get an exception, or does it return the wrong data? If the
> wrong data then too much or too little or just the wrong value?
I get no exception... no data either..
> A script that creates the two tables, adds some data to illustrate
> the problem would really help.
I attached a sample script...
Sascha
--
.-> Sascha Matzke - sascha@bespin.de ------------------------.
| Eure Moral, Eure MGs werden nicht ewig regier'n... |
| Anarchist Academy |
`-- On this earth for 24 years, 355 days <----------------'
; First load the JDBC driver and open a database.
d org.enhydra.instantdb.jdbc.idbDriver;
o jdbc:idb=sample.prp;
e drop table UnitOptions;
e drop table Unit;
e create table Unit (
id varchar(256) not null unique primary key,
type varchar(256) ,
title varchar(256) ,
subtitle varchar(256) ,
note varchar(256) ,
description text,
authors varchar(256),
fieldOfInterest varchar(256) ,
targetGroup varchar(256) ,
targetArea varchar(256) ,
);
e create index type_idx on Unit (type);
e create index fio_idx on Unit (fieldOfInterest);
e create index tg_idx on Unit (targetGroup);
e create index ta_idx on Unit (targetArea);
e create table UnitOptions (
unitId varchar(256) foreign key references Unit(id),
fieldname varchar(256) not null,
value varchar(256) not null
);
e create index unitfieldname_idx on UnitOptions(fieldname);
e create index unitvalue_idx on UnitOptions(value);
e insert into Unit values('12345','Unterrichtswerke','Biologie','','','','Meier, Klaus; Müller, Ulrich','Biologie','Grundschule','Berlin, Brandenburg, Niedersachsen');
e insert into UnitOptions values('12345','type','Unterrichtswerke');
e insert into UnitOptions values('12345','authors','Meier, Klaus');
e insert into UnitOptions values('12345','authors','Müller, Ulrich');
e insert into UnitOptions values('12345','fieldOfInterest','Biologie');
e insert into UnitOptions values('12345','targetGroup','Grundschule');
e insert into UnitOptions values('12345','targetArea','Berlin');
e insert into UnitOptions values('12345','targetArea','Brandenburg');
e insert into UnitOptions values('12345','targetArea','Niedersachsen');
|