SQL conditional statements?
===

I'm trying to write a query for a table in SQLCE and compact-framework but the query needs to read every row with two conditions. 

Column 'location' in any given row may or may not be null, if it's not null it needs to be checked for its value, if it's null the row should be selected, i.e:

    if( location!= null )
    {
        if( d == "location" )
             SELECT;
    }
    else
        SELECT;

Anyone know how I can go about doing this?