Need to Fetch the data which are not present based on one particular ID
There is one master table which contains all the details of the customer. A view is been created on this master table to fetch the data from all other child tables which are connected to master table using foreign key constraints. There is one seller table which has the information about seller who sold to which customer, I want to show data of the master table for the seller who has not sold to a customer so that he can be assigned to the new customer. Note: one customer can have multiple seller assigned to him
Without access to your schema, it's difficult to know, but something along these lines? Tables * Seller - SellerID (key), company name, address, etc * Customer - CustomerID (key), name, shipping address, etc * Transactions - TransactionID, SellerID, CustomerID, Date, etc... Query: SELECT * FROM Seller WHERE SellerID NOT IN ( SELECT SellerID FROM Transactions ) Something like that?