If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Excluding
Hello,
I've got a table containing suppliers (two fields: supplier_code and supplier_name) and another one containing suppliers' codes to exclude from showing up. Since I've got more than 45 suppliers to exclude, I've given up with the idea of putting everything in the criteria with the "not like" expression. Is someone know how to perform this condition in my query? If yes, any suggestions? Thanks, gmore |
#2
|
|||
|
|||
Excluding
/* Powered by General SQL Parser (www.sqlparser.com) */
SELECT S.supplier_code, S.supplier_name FROM tbl_suppliers AS S LEFT JOIN tbl_exclude AS E ON S.supplier_code = E.supplier_code WHERE E.supplier_code IS NULL tbl_suppliers - the table that you want to select the data from tbl_exclude - the table with the supplied codes you want to exclude This will select all records from tbl_suppliers where there is no match in tbl_exclude. Cheers, Jason Lepack On Feb 22, 3:22 pm, gmore wrote: Hello, I've got a table containing suppliers (two fields: supplier_code and supplier_name) and another one containing suppliers' codes to exclude from showing up. Since I've got more than 45 suppliers to exclude, I've given up with the idea of putting everything in the criteria with the "not like" expression. Is someone know how to perform this condition in my query? If yes, any suggestions? Thanks, gmore |
#3
|
|||
|
|||
Excluding
Thanks
"Jason Lepack" wrote: /* Powered by General SQL Parser (www.sqlparser.com) */ SELECT S.supplier_code, S.supplier_name FROM tbl_suppliers AS S LEFT JOIN tbl_exclude AS E ON S.supplier_code = E.supplier_code WHERE E.supplier_code IS NULL tbl_suppliers - the table that you want to select the data from tbl_exclude - the table with the supplied codes you want to exclude This will select all records from tbl_suppliers where there is no match in tbl_exclude. Cheers, Jason Lepack On Feb 22, 3:22 pm, gmore wrote: Hello, I've got a table containing suppliers (two fields: supplier_code and supplier_name) and another one containing suppliers' codes to exclude from showing up. Since I've got more than 45 suppliers to exclude, I've given up with the idea of putting everything in the criteria with the "not like" expression. Is someone know how to perform this condition in my query? If yes, any suggestions? Thanks, gmore |
Thread Tools | |
Display Modes | |
|
|