sql - SQLite combo-request with concatenating results -


i use sqlite, , want create request such option.

i have 2 tables a, b. in records contain field id integers, , field string, example name

in table b have columns names:

number a<name1> a<name2> a<name3>...  

i need number table b, field a<namek> equal value, name id in table a. know id , want know number b.

so have 2 requests.

select name my_name id=<value>; 

and after want that:

select number b a||my_name = <value>; 

( || - mean concatenacting of strings), it's not work:(

update - example of tables structures:

a:

id name 1    2   b 3   c 

b:

number aa ab ac 10      1  2  3 11      4  5  6 12      7  8  9 

so example id=2, value in b=5, name=b, column name in b ab. result number=11

id=3, value=6. result number=11

id=3, value=4. result no result

without more information table structure, highly assume flawed. save a<name>'s number in individual rows, if necessary column flags.


Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -