Wordpress - Two WordPress sites sharing the same content
If the URLs are the only difference between the installs you can edit one of the config.php files and add
define('WP_HOME','http://A.mysite.com');
define('WP_SITEURL','http://A.mysite.com');
and to the other config.php add
define('WP_HOME','http://B.mysite.com');
define('WP_SITEURL','http://B.mysite.com');
Both installs will use the same database info only the URLs being different.
However you will have to take care of other possibly different aspects like plugins, users, theme, and so on.
The same way you can define any other different setting case by case.