| Subject: | Re: Combining two tables MYSQL |
|---|---|
| From: | "paross1" <webforumsuser@xxxxxxxxxxxxxx> |
| Date: | Thu, 31 Jul 2008 15:10:17 +0000 (UTC) |
| Newsgroups: | macromedia.coldfusion.database_access |
How about combining them, order by aa.assetActionType, then group by that field
in the output?
SELECT a.assetID,
a.assetDescription,
a.assetLocation,
aa.assetActionID,
aa.assetActionType,
aa.assetActionResult
FROM asset a
INNER JOIN assetAction aa ON aa.assetActionAssetID = a.assetID
WHERE aa.assetActionType IN ('E', 'V')
AND aa.assetActionID = (SELECT MAX(x.assetActionID)
FROM assetAction x
WHERE x.assetActionAssetID = a.assetID
AND x.assetActionType = aa.assetActionType)
ORDER BY aa.assetActionType , a.assetID
Phil
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: Combining two tables MYSQL, Jochem van Dieten **AdobeCommunityExpert** |
|---|---|
| Next by Date: | Re: Combining two tables MYSQL, Mi-ul |
| Previous by Thread: | Re: Combining two tables MYSQL, paross1 |
| Next by Thread: | Re: Combining two tables MYSQL, Mi-ul |
| Indexes: | [Date] [Thread] [Top] [All Lists] |