Inner Join user tables to select users with roles

The Problems

You risk SQL injection, with your current setup:

$wpdb->users.display_name LIKE '$ltr%'

The following could also be a problematic part in your SQL query:

AND $wpdb->usermeta.meta_value = %artist%

i.e. using = instead of LIKE.

You’re also missing the quotes: %\"artist\"%, to exclude e.g. bartist or fartist 😉

But you don’t need to construct this SQL query by hand.

Better Alternatives

You could use the WP_User_Query class:

$users = new WP_User_Query( [ 'role' => 'artist' ] );

or it’s get_users() wrapper instead:

$users = get_users( [ 'role' => 'artist' ] );

It will generate the SQL query for you, with the INNER JOIN.

tech