Quantcast
Channel: VBForums - Database Development
Viewing all articles
Browse latest Browse all 2918

[RESOLVED] remove single value from query

$
0
0
Hey all
I have 2 tables A & B
Table A
id name suffixID
0 him 0
1 her 1
2 it 2

Table B
id name isActive
0 Mr. 1
1 Mrs. 1
2 other 0


and this query...
SELECT A.name as Name,B.name as Suffix
FROM A
LEFT JOIN B ON A.suffixID = B.id

should return a table like this (unless my syntax is off which is quite possible)...
Table C
Name Suffix
him Mr.
her Mrs.
it other
What I need to do is eliminate the value for B.name whereever B.isActive=0. I don't want to remove the row, just the value in the row to have something like this...
Table C
Name Suffix
him Mr.
her Mrs.
it
Can anyone tell me how to adjust the sql to achieve that?
Thanks
kevin

Viewing all articles
Browse latest Browse all 2918

Trending Articles