2
I have the following structure:
http://sqlfiddle.com/#! 9/29027c4/1
CREATE TABLE PATRIMONIO (
    NUM_PATRIMONIO VARCHAR(100),
    DESCRICAO_PATRIMONIO VARCHAR(100)
);
INSERT INTO PATRIMONIO 
VALUES ('HDT-2725','VW/GOL 1.0 GER IV'),
('HDT-2744','VW/GOL 1.0 GER IV'),
('HDT-2751','VW/GOL 1.0 GER IV'),
('HDT-2764','Fiat Palio Celebration 1.4 Fire Flex 8V 4p'),
('002376','Notebook Dell i5 8GB 1TB')
With the following select:
SELECT NUM_PATRIMONIO, DESCRICAO_PATRIMONIO FROM PATRIMONIO
This is not the complete structure of the table, this was just an example that came from how the data is appearing. At the moment, they are coming like this:
NUM_PATRIMONIO  DESCRICAO_PATRIMONIO
HDT-2725        VW/GOL 1.0 GER IV
HDT-2744        VW/GOL 1.0 GER IV
HDT-2751        VW/GOL 1.0 GER IV
HDT-2764        Fiat Palio Celebration 1.4 Fire Flex 8V 4p
002376          Notebook Dell i5 8GB 1TB
And I need the return to be just the vehicles that are wearing the mask of the plates XXX-0000. The bank only has Brazilian plates, so other formats are irrelevant.       
I’ve tried to find some function or even ways to do this query on google, but what I always find are people looking for how to consult a Pf without mask and put the mask at the time of the query. But I don’t want to put the mask, I need to filter the data that already have this mask XXX-0000.
The database is SQL Server.
Thank you very much. That’s exactly what I needed, and I had no idea how easy it was!
– Layla Comparin