Queries save

Hello i have result from a query like:
TableA|TableB
one | book
two | lamps
three |doors

now i want to save this like:
a= “one book”, b= “two lamps”, c=…

how can i implement this in ruby?

greats