You can add the photos of library A to library B this way:
1 - Command (right) - click on library A and select Show Package contents from the contextual menu.
2 - locate the Originals (iPhoto 8 or earlier) or Masters (iPhoto 9 and later) folder.
3 - launch iPhoto and open Library B.
4 - drag the subfolders from the Originals/Masters folder in Library A into the open window of Library B.
5 - when iPhoto askes about duplicates decline to import them.
This will put only the orignal files of Library A into Library B. However this is not the same as merging the two libraries. Merging would include bringing over the edited versions, keywords, titles, albums, descriptions, places, etc.