It looks as if you counted numbers like $399$, or $919$, or $991$ more than once.
It is easier to count the numbers that don't have a $9$. There are $8$ from $1$ to $9$. For $10$ to $99$, the first digit can be any of $8$, and for each choice the second digit can be any of $9$, for a total of $8\cdot 9$. Similarly, for $100$ to $999$, the first digit can be any of $8$, and for any first digit, there are $9\cdot 9$ ways to choose the rest, for a total of $8\cdot 9\cdot 9$.
Add up, subtract from $999$.
Another way: It is slightly easier to insert if necessary lead $0$'s to make every number from $0$ to $999$ a three-digit number. Then there are $9^3 -1$ "nine-free" numbers (we do not allow $000$). Subtract from $999$.