Forum

Putting db tables together over id(SQL)

hey,

i got a database with several tables. all the tables are leaded by an ID field, the trick is to put all the entries with the same id together.

my partner tried to do this with a SQL command but hes not working at the moment.

my way:
i tried to use several select(sql) nodes to spit out the table entries leaded by the id. (sorted by id)

i used a SetSlice node for keeping the id as slice-index and then putting the entries to the right slice, and in the next step puttung strings together with +(string).

thougt it will work like that, but it doesnt. setslice is not the best choice i think…

i will prepare a patch to understand it but now its a bit late:)

anyone expierenced with sql stuff?

jesus…

the other question is how to
bring strings together like that,

Stringspread 1:
1,Monday
3,Wednesday
5,Friday

Stringspread 2:
3,Swimming
3,Cooking
1,Working
5,Nothing

to

1,Monday,Working
2,
3,Wednesday,Swimming,Cooking
4,
5,Friday,Nothing

i’m not quite clear on the first question… the second is manageable, but could take some spreadjuggling. can’t patch an example right now, but i’d throw the following nodes in the mix: RegExpr (String) or Separate (String) , AsValue (String) and AsString (Value) , Sort (Spreads) and nifty use of Sift (String) & Sift (Value) . I (Spreads) , GetSlice (String) & SetSlice (String) could help, too… uhm - i hope this helps? :)

for the sql thing have a look at join and group-concat. then you’d probably already get the desired result.
if not, try separate to split the ids from the content and try my = String Spectral module to search for equal ids. then add the content back together

okay, we got some help and now we manage it over sql.

thats a more solid way, thanks quys!