Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 3 of 3 total |
Query from a union |
Thu, Apr 9 2015 11:30 AM | Permanent Link |
Boss | Hi I'm trying to narrow down my search, I need to group by the GUID and grab the max value from the two queries that were union.
Working union script Select * from memory\m2 as X union select * from memory\m3 as y my goal is to do something along the lines of this sql statement select GUID, Max(amount) as Amount from (Select * from memory\m2 as X union select * from memory\m3 as y) as z") group by GUID Both X and Y have 2 columns [GUID, Amount] May I ask how would I selected from the union? |
Tue, Apr 14 2015 1:36 PM | Permanent Link |
Boss | Bump
|
Wed, Apr 15 2015 5:52 AM | Permanent Link |
Jose Eduardo Helminsky HPro Informatica | Boss
<< Hi I'm trying to narrow down my search, I need to group by the GUID and grab the max value from the two queries that were union. Working union script Select * from memory\m2 as X union select * from memory\m3 as y my goal is to do something along the lines of this sql statement select GUID, Max(amount) as Amount from (Select * from memory\m2 as X union select * from memory\m3 as y) as z") group by GUID Both X and Y have 2 columns [GUID, Amount] May I ask how would I selected from the union? >> Select * INTO MEMORY\M4 from memory\m2 as X union select * from memory\m3 as y ; select GUID, Max(amount) as Amount from memory\m4 group by GUID |
This web page was last updated on Monday, May 6, 2024 at 03:23 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |