Nested select

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Patrick Clarke

    Nested select

    Happy friday to all. Those of you in Canada reading this message Happy
    Thanksgiving weekend!!

    I'm trying to display a bunch of checkboxes in php and have them
    checked/not checked based on the results of the following query but
    I'm getting syntax errors. This would work in mssql how would I
    accomplish the same thing in mysql?

    SELECT tblOrg_Type.ID, tblOrg_Type.Org _Type, (Select 'Checked' from
    tblContactOrgTy pe where OrgID = 8 AND tblOrg_Type.ID =
    tblContactOrgTy pe.OrgTypeID ) AS Checked
    FROM tblOrg_Type;

    Table Structures:

    tblOrg_Type
    ID
    Org_Type

    tblContactOrgTy pe
    ID
    OrgID
    OrgTypeID
Working...