Quantcast
Channel: Oracle, MySQL, Sybase, Informix and other databases
Viewing all articles
Browse latest Browse all 1350

Need help on query from multiple tables using group by clause

$
0
0

Hi,

Trying to get the below result in query using group by from below 3 tables. if you notice there are two items in table 1. one item with color one another black. i thing we may use max(), min() function.

Result:

PROJECT_NUMINSPECT_DATEDEFI_CODELIFE_SAFETYON_PRIOR_REPREPAIR_TIME
6000026/8/2018C*Y10
6000026/8/2018C*Y8

Table1:

PROJECT_NUMBUILDING_IDINSPECT_DATEPHY_CONDCOND_CATEGORYDEFI_CODELIFE_SAFETYON_PRIOR_REPREPAIR_TIME
60000225596/8/2018EXTERIORParapetsC*N10
60000225596/8/2018EXTERIORFoundation WallsMY8
60000225596/8/2018EXTERIORFacadeMN5
60000225596/8/2018EXTERIORRoofsMN5
60000225596/8/2018EXTERIORFlashingC*N8
60000225596/8/2018EXTERIORDrainsM*Y4
60000225596/8/2018EXTERIORVents

Table2:

CATEGORY_IDCOND_CATEGORYITEM_INSPECTEDCREATION_DATELAST_UPDATE_DATE
1Parapets1
2Facade1
3Foundation walls1
4Roofs2
5Flashing2
6Drains2
7Vents2

Table3:

ITEM_INSPECTEDITEM_DESCRIPTIONITEM_CATEGORYCREATION_DATELAST_UPDATE_DATE
1Exterior Walls and foundationExterior Items Inspected
2Roofs, flashing, ventsExterior Items Inspected
3Gutters, Downspouts, splash blocksExterior Items Inspected
4Drives, parking lots, curbsExterior Items Inspected
5Walks, steps, guardrailsExterior Items Inspected
6Fences, walls, gatesExterior Items Inspected

Viewing all articles
Browse latest Browse all 1350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>