开发者

Convert single value into multiple lines

开发者 https://www.devze.com 2023-01-28 19:47 出处:网络
i\'m converting a database. i have to convert a single column value (ie \"bedrooms\": 3) into multiple lines into another table

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

精彩评论

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

关注公众号