SQL Filter to not display some items from a table

Asked

Viewed 31 times

1

Good morning! All right? On the website I’m working on, it displays a list of countries that come from the database. However, there was a requirement that the countries sanctioned by OFAC.

It calls countries with the following SQL commands:

 var sql = @"
        SELECT
            id, nome_pt AS nome
        FROM loc_pais
        ORDER BY nome_pt
    ";

My question is ; "I can put a filter to not display those countries that are sanctioned, or would it be better to exclude them from the table?

1 answer

6


If not, include a column in the "loc_pais" table of type "bit", for example "sanctioned ofac" and update the table with which countries are sanctioned (sancionado_ofac=1).
Then just add one where sancionado_ofac = 0 in your query

  • vlw man, I’m gonna do this scheme!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.