Yes, wildcards work in combination with a LIKE operator when working with the world database. Make sure to put apostrophes (') around the name (single quotes represent SQL strings), i.e. one on the left, one on the right. For example, if you have a player name "angriff" and want to find all npcs which are called "angriff" followed by 2 digits or letters (e.g. "angriff01", "angriff42", "angriffXY" etc), the SQL statement would look like SELECT COUNT(*) AS count FROM npcs WHERE name LIKE 'angriff__';. Since your player name is a variable, you have to use string concatenation. The code could look like this:
Please bear in mind that the _ wildcard character represents one character, while % represents zero, one or more characters. So looking for "angriff__" (with 2 underlines) will find "angriff01", "angriff42" etc, but not "angriff1", for example.