Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>After making it a bit more readable there doesn't seem to be much wrong. I removed the brackets as they aren't needed. I would also put the INNER JOINS the other way round as its normal to put them in this order.</p> <p>SELECT column_name(s) FROM table_name1 INNER JOIN table_name2 ON table_name1.column_name=table_name2.column_name</p> <p>So it should look something like</p> <pre><code>select INSURED.FNAME + ' ' + INSURED.LNAME AS MNAME, INSURED.MEMBCODE as MEMBERCODE, INSURED.POLICYNO AS POLICYNO, INSURED.POLICYFRMDATE AS POLICYFROMDATE, INSURED.POLICYTODATE AS POLICYTODATE, MEMBERSHIP.MRKEXTNAME AS MARKETINGEXECUTIVE, MEMBERSHIP.EMPLOYEECOUNT AS EMPLOYEECOUNT, INSURED.CLAIMID AS CLAIMID, POLICY.POLICYTYPE, POLICY.COVAMTHOSPITAL as SUMINSURED, ORGANIZATION.ORGANIZATIONNAME FROM INSURED INNER JOIN MEMBERSHIP on INSURED.MEMBERSHIPID=MEMBERSHIP.MEMBERSHIPID INNER JOIN POLICY on POLICY.POLICYNAME=MEMBERSHIP.POLICYNAME INNER JOIN ORGANIZATION on MEMBERSHIP.ORGANIZATIONID=ORGANIZATION.ORGANIZATIONID WHERE INSUREDID=427 </code></pre> <p>You need to tell us what the problem is. Does it return results different to what you are expecting or does it fail with an error.</p> <p>You should also tell us which database you are using. </p> <p>Also there appears to be something odd about your table structure. You would not normally store PolicyName in your Membership Table rather you should be linking with ID Fields of some kind rather than PolicyName Strings...Something Like</p> <p>INNER JOIN POLICY on POLICY.POLICYID=MEMBERSHIP.POLICYID </p> <p>You got it right for with OrganizationID and MEMBERSHIPID</p> <p>In short you need to tell us more about it.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload