mike509123
MIS
I have two sql statements. The first has a unique primary key on name, whereas the second is a one to many relationship on name. I would like to join the two queries so the result looks like:
John Smith, 234 Jones Rd, 430-293-3928, note1
John Smith, 234 Jones Rd, 430-293-3928, note2
John Smith, 234 Jones Rd, 430-293-3928, note3
John Smith, 234 Jones Rd, 430-293-3928, note4
Bill Jones, 259 Red River Rd, 939-239-4893, note1
Bill Jones, 259 Red River Rd, 939-239-4893, note2
The only stipulation is that you can modify the statements, I have sort of dummied down the statements as they are quite complex. So you can add stuff or put modifiers between the statements. For example if there is a way to just add some sort of union statment in between the two or something else along those lines.
select name, address, phone number
from address_book
select name,notes
from notes_table
John Smith, 234 Jones Rd, 430-293-3928, note1
John Smith, 234 Jones Rd, 430-293-3928, note2
John Smith, 234 Jones Rd, 430-293-3928, note3
John Smith, 234 Jones Rd, 430-293-3928, note4
Bill Jones, 259 Red River Rd, 939-239-4893, note1
Bill Jones, 259 Red River Rd, 939-239-4893, note2
The only stipulation is that you can modify the statements, I have sort of dummied down the statements as they are quite complex. So you can add stuff or put modifiers between the statements. For example if there is a way to just add some sort of union statment in between the two or something else along those lines.
select name, address, phone number
from address_book
select name,notes
from notes_table