Sorry if there's the same question somewhere already. I've been trying to find out what's the difference between 'in the supermaket' & 'at the supermarket', or 'at a restaurant' & 'in a restaurant'. Is there a difference at all? Thanks
See A sentence.

"in" means physically inside the building, while "at" gives more of a sense that building is a location in space (a place on a map, if you want to think of it like that).

If you're inside the building then both "in" and "at" are possible. I perceive little practical difference between the two, but I probably have a slight preference for "at" -- unless for some reason it was important and non-obvious that I was actually inside the building, and I wanted to make this clear, in which case I'd use "in".

If you're immediately outside the building then you can use "at" but not "in".
 CalifJim's reply was promoted to an answer.