"The Andy Griffith Show" is a spinoff of "The Danny Thomas Show". Danny Thomas appeared in the first episode. Frances Bavier is in the episode but not as Aunt Bee.
Barney may have touched on his filing system on 'Three's A Crowd' while looking for a letter that he eventually founf behind the filing cabinet. He also so stated he would not remove a wanted poster...
After The Andy Griffith Show had run it's course Griffith changed gears. He played attorney Ben Matlock, kind of a bumbler with a bad suit. But of course he always solved the murder and his clients...