could wish someone would propose a truly deep database design question...
everyone tells me I'm no DBA but anyway you have already created it and
filled it, but the syntax is wrong

On Sun, Jan 18, 2015 at 6:10 PM, YAN HONG YE <yanhong...@mpsa.com> wrote:

> I don't know how to create this table:
>
> There 4 objects:
>
> Aa, bb,cc, res
>
> create table some_table_name_here (

> Aa text,  //is name of a1,a2,a3,a4,a5 type
> Bb text,  //is name of b1,b2,b3,b4,b5 type
> Cc int, //is only 1,0 type
> Res int // is result value
>
)

insert into some_table_name_here (a1,b1,cc,res)  values

> If a1 and b1 and cc=1,then the value is 10

('a1','b1',1,10)

> If a1 and b1 and cc=0,then the value is 5;
>
, ('a1','b1','0,5)

> If a2 and b1 and cc=1,then the value is 12;
>
, ('a2,b1,1,12)
 .............

> If a2 and b1 and cc=0,then the value is 6;
> If a3 and b1 and cc=1,then the value is 8;
> If a3 and b1 and cc=0,then the value is 3;
> If a4 and b1 and cc=1,then the value is 10;
> If a4 and b1 and cc=0,then the value is 9;
> If a5 and b1 and cc=1,then the value is 20;
> If a5 and b1 and cc=0,then the value is 4;
> If a2 and b2 and cc=1,then the value is 30;
> If a2 and b2 and cc=0,then the value is 50;
> .......
>

; (end insert statement)



>
> I want do a select cmd:
> Select res from mytable where aa=a4 and bb=b3;
>
select cc,res from some_table_name_something wehre aa='a4' and bb='b3'
order by cc ?


>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to