SQL Select Issue

Jeff Stiegler 466 Reputation points
2022-10-31T16:19:24.273+00:00

If the client.race field is blank for a row then it is not selected in the statement below. However, I want these rows to be select. Is there a way to do this?

SELECT last_name, client.race, ethnicity.descrip From client  
JOIN ethnicity on client.race = ethnicity.race  
  
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,656 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jingyang Li 5,891 Reputation points
    2022-10-31T16:32:34.913+00:00
    SELECT last_name, client.race, ethnicity.descrip   
    From client  
     LEFT JOIN ethnicity on client.race = ethnicity.race  
    
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.