newphpbees Posted December 20, 2011 Share Posted December 20, 2011 Hi... i had encountered problem in my select statement.. here is my query: SELECT s.EMP_NO, p.SSS, CONCAT(LNAME, ', ', FNAME, ' ', MI, '.') AS FULLNAME, s.SSSLoan, s.SSSAmor FROM hris.PERSONAL p, hris.employment em, payroll.sssloan s WHERE em.EMP_ID = p.EMP_ID AND em.EMP_NO = s.EMP_NO; the output of this query is all data in SSSLoan was displayed..I want to display only is the employee that i choose. Thank you Quote Link to comment Share on other sites More sharing options...
fenway Posted December 20, 2011 Share Posted December 20, 2011 First, you should rewrite your query using JOINS. Second, you'll want to add an expression to the WHERE clause, "em.EMP_ID = '$whatever'" (probably escaped and secured, of course). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.