I had a quick look at Google Finance (Financials, Annual Data) and I see the following for 2012: Amazon's total operating expenses as a percentage of revenue was 98.2%. Costco's was 97.2%. Wal-mart's was 94.1%. Based on this data, you might argue that Amazon has a cost disadvantage relative to both Costco and Wal-mart. But before reaching any conclusions you would need to back out Amazon Web Services and the Kindle (from Amazon) [1].
As a quick and dirty analysis, we can back out the $2.909b Amazon invested in R&D in 2012. Note, neither Costco nor Wal-mart have a line item for R&D. In this case, Amazon's operating expenses as a percentage of revenue is 92%, or about 5% less than Costco's and 2% less than Wal-mart's. [2]
-
[1] You might also want to back out Sam's Club from Wal-mart.
[2] Given Amazon has revenues that are just 11% of Wal-mart's, you could argue that Amazon's cost advantage will likely increase as it further scales revenue and operations.