开发者

Convert single value into multiple lines

i'm converting a database.

i have to convert a single column value (ie "bedrooms": 3) into multiple lines into another table

be开发者_Go百科droom | 1

bedroom | 1

bedroom | 1

i'm using MS-Access to convert everything into a MySQL db, how can i do that?


Assuming you have a finite number of plural nouns, just write some VBA to use brute force.

pseudo code:

// suppose roomcount == bedrooms:3

room = whateverisbeforecolon (roomcount);  // bedrooms
count = whateverisaftercolon (roomcount);  // 3
if room = "bedrooms" then
begin
  for i = 1 to count do
     DoSomeSQL('insert into floorplan (listingnumber,roomtype,qty) values('1234','bedroom','1')');
end;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜