user_branch ---------------------------------- Sr-no | Username | Branch | ---------------------------------- 1 | User 1 | A | 2 | User 1 | B | 3 | User 2 | A | 4 | User 2 | C | ---------------------------------| user_acct_type ----------------------------------- Sr-no | Username | Acct_type | ----------------------------------- 1 | User 1 | D | 2 | User 1 | E | 3 | User 2 | F | 4 | User 2 | G | -----------------------------------| cust_code --------------------------------------------------------------------------- Sr-no | Customer Name | Customer Code | Branch | Account Type | --------------------------------------------------------------------------- 1 | Customer 1 | 1234 | A | D | 2 | Customer 2 | 1235 | C | F | 3 | Customer 3 | 1236 | B | G | 4 | Customer 4 | 1237 | A | H | --------------------------------------------------------------------------|
select c.Cust_Name as Customer from custcode c inner join user_branch b on c.branch = b.branch inner join user_acctype a on c.Cust_typeofaccount = a.acctype order by c.Cust_Name
SELECT a.`Sr-no`, a.`Customer Name`, a.`Customer Code` FROM `cust_code` a, `user_acct_type` b, `user_branch` c WHERE b. `Acct_type`=a.`Acct_type ` AND c.`Branch`=a.`Branch` AND b.`Username`=c.`Username` AND c.`Username`='User 1'
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)