Filter data from a gridview according to a second table

0

Dear,

I have the following doubt, in visual basic, with database sql server, I want a datagridview to show me the data of a table in my database called auto_marks_list, but it leaked without showing the marks of the cars that are stored in another table called marcas_ya_edresadas

For example, the table listing_cars_autos contains the marks of all the cars that would be: chevrolet, toyota, kia, jeep, hyndai If I in the other table called marcas_ya_enrested that at the beginning is empty, I enter the brand "toyota". then when loading the gridview it should show all the marks that appear in the table auto_marks, except for the marks that are in the table marcas_ya_edresadas, in this case "toyota".

    
asked by Francisco 29.11.2017 в 19:55
source

1 answer

0

I think the query would be like this:

SELECT LMA.*  
FROM listado_marcas_autos AS LMA  
FULL JOIN marcas_ya_ingresadas AS MYI ON LMA.ID = MYI.ID  
WHERE MYI.ID IS NULL
    
answered by 30.11.2017 / 16:38
source