You can't have substitution IF statements on extra substitutions (so the columns can't be used in IF substitutions). So what you're wanting isn't possible without a 3rd field. The 3rd field would purely be querying for a logo. This would allow you to condition off that 3rd field so you could do something like the below.
Field Name: cb_team_logo_url
Query:
Code:
SELECT `logo` FROM `#__team` WHERE `id` = '[cb_team]'
Output: Single Row
Columns: Single Column
The above would output the logo URL. Place it on a tab in a not shown on profile position so it can be used for substitutions only as needed. Next in cb_team_logo you should be able to adjust the custom output as follows.
FROM:
Code:
<img src="[column_logo]" alt="[column_name]" />
TO:
Code:
[cb:if cb_team_logo_url!=""]<img src="[column_logo]" alt="[column_name]" />[/cb:if]
[cb:if cb_team_logo_url=""][column_name][/cb:if]
Please understand the above is just an example. I've no idea your database structure so I've no idea if the queries will even work. I have not tested the above. You may need to make adjustments.
An alternative is to edit your query and have the query it self format the <img tag, which would eliminate the need for a 3rd field.