combination product through sql -


i store option values , categories in table.

i want 1 column possible combinations of option values.

for example:

  • option category id (1,2,5)
  • option values {(31,39,55),(61,62),(98,99)}

i want listing this, in 1 column:

31 61 98  31 61 99  31 62 98  31 62 99  39 61 98  39 61 99  39 62 98   39 62 99  55 61 98  55 61 99  55 62 98  55 62 99 

please see below screen shot

enter image description here

not answer, leave here work it

schema, data sample , query show.

select * #a from( select 1 prod,1 id union select 1,2 union select 1,5 )a  select * #b from( select 1 id,31 cat union select 1,39 union select 1,55 union select 2,61 union select 2,62 union select 5,98 union select 5,99  ) b   select * #a inner join #b b on a.id=b.id 

and retrieves 1 row of tree items for, in order need

select b1.cat 'a', b2.cat 'b', b3.cat 'c'  #b b1, #b b2, #b b3, #a a1  a1.id=b1.id , b2.id>a1.id , b3.id>a1.id , b3.id>b2.id     , b1.cat<b2.cat , b2.cat<b3.cat order b1.cat, b2.cat, b3.cat  

i'll come latter


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -