Effizient Art und Weise zu schreiben, die unter abfragtprüfen Null/Nicht Null in Spalten
where col_1 is not null and((col_2 is not null and col_3 is not null)<br/>
or (col_4 is not null and Col_5 is not null)<br/>
or(col_3 is not null and col_4 is not null)<br/>
or(col_2 is not null and Col_5 is not null)<br/>
)<br/>
<br/>
<br/>
<br/>
col_1 is null and ((col_2 is null and col_3 is null and col_4 is null and col_5 is null)<br/>
or (col_2 is not null and col_3 is null and col_4 is null and col_5 is null)<br/>
or (col_2 is null and col_3 is not null and col_4 is null and col_5 is null)<br/>
or (col_2 is null and col_3 is null and col_4 is not null and col_5 is null)<br/>
or (col_2 is null and col_3 is null and col_4 is null and col_5 is not null)<br/>
)<br/>
Sie sollten wahrscheinlich die Tabellenentwurf ändern. Brauchst du Hilfe dabei? –
ich habe nicht bekommen, was Sie beabsichtigten, das Tischdesign zu ändern? – user3255656
Wenn Sie nur nach mindestens einem nicht null suchen, verwenden Sie: 'coalesce (col1, col2, col3, col4, col5) ist nicht null '. Uns ist nicht klar, nach welchen Kombinationen Sie suchen. – shawnt00