daily pastebin goal
7%
SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2.         o.*,GROUP_CONCAT(DISTINCT mt.mobilityTypeName) as mobility,GROUP_CONCAT(DISTINCT st.serviceTypeName) as service,GROUP_CONCAT(DISTINCT  tt.steamTypeName) as stream,GROUP_CONCAT(DISTINCT pt.providerTypeName) as provider
  3. FROM
  4.         Organizations o
  5. # mobilty
  6. INNER JOIN
  7.         Organizations_has_mobilityType oht on oht.Organizations_organizationID = o.organizationID
  8. INNER JOIN
  9.         mobilityType mt on mt.mobilityTypeID = oht.mobilityType_mobilityTypeID
  10.  
  11. # service
  12. INNER JOIN
  13.         Organizations_has_serviceType sht on sht.Organizations_organizationID = o.organizationID
  14. INNER JOIN
  15.         serviceType st on st.serviceTypeID = sht.serviceType_serviceTypeID
  16.  
  17. # steam
  18. INNER JOIN
  19.         Organizations_has_steamType tht on tht.Organizations_organizationID = o.organizationID
  20. INNER JOIN
  21.         steamType tt on tt.streamTypeID = tht.steamType_streamTypeID
  22.        
  23.  
  24. # providers
  25. INNER JOIN
  26.         providerType_has_Organizations pht on pht.Organizations_organizationID = o.organizationID
  27. INNER JOIN
  28.         providerType pt on pt.providerTypeID = pht.providerType_providerTypeID
  29.  
  30.  
  31. WHERE o.`wheelChairAccessible` = 1 AND
  32. st.serviceTypeID in (1,2,3) AND
  33. mt.mobilityTypeID in (2,4) AND
  34. tt.streamTypeID in (2,3,4,5) AND
  35. pt.providerTypeID in (1,2,3,4,6,7)
  36.  
  37. GROUP BY o.organizationID;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top