473,772 Members | 3,665 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is max doing across fields in a de-duplication ?

Greetings folks,

Just curious if anyone knows what the following would produce:
SELECT
MAX( ECP_SUPPORT_DED _EMAIL.CD_TYP_C MPGN) CD_TYP_CMPGN,
MAX(ECP_SUPPORT _DED_EMAIL.CELL _ID) CELL_ID,
ECP_SUPPORT_DED _EMAIL.CLIC_CUS T_ID CUSTID,
MAX( ECP_SUPPORT_DED _EMAIL.ADDRESS) CONTACTED_PARTY ID,
MAX( ECP_SUPPORT_DED _EMAIL.CONTACTE D_PARTY_ID_TYPE )
FROM
ECP_SUPPORT_DED _EMAIL
group by CUSTID

For a given CUSTID, and assuming all fields are character and there
are duplicates, will it randomly select the MAX value of any of these
fields across duplicates, or will it randomly select a custID and
retain that row's attributes with integrity?

thanks!
Jack
Jul 19 '05 #1
2 2334
Jan
I have no idea, but let`s guess - it will return the max values of the
rows for each custid?

ja***********@y ahoo.com (Jack) wrote in message news:<20******* *************** ****@posting.go ogle.com>...
Greetings folks,

Just curious if anyone knows what the following would produce:
SELECT
MAX( ECP_SUPPORT_DED _EMAIL.CD_TYP_C MPGN) CD_TYP_CMPGN,
MAX(ECP_SUPPORT _DED_EMAIL.CELL _ID) CELL_ID,
ECP_SUPPORT_DED _EMAIL.CLIC_CUS T_ID CUSTID,
MAX( ECP_SUPPORT_DED _EMAIL.ADDRESS) CONTACTED_PARTY ID,
MAX( ECP_SUPPORT_DED _EMAIL.CONTACTE D_PARTY_ID_TYPE )
FROM
ECP_SUPPORT_DED _EMAIL
group by CUSTID

For a given CUSTID, and assuming all fields are character and there
are duplicates, will it randomly select the MAX value of any of these
fields across duplicates, or will it randomly select a custID and
retain that row's attributes with integrity?

thanks!
Jack

Jul 19 '05 #2
ja***@pobox.sk (Jan) wrote in message news:<81******* *************** ****@posting.go ogle.com>...
I have no idea, but let`s guess - it will return the max values of the
rows for each custid?

ja***********@y ahoo.com (Jack) wrote in message news:<20******* *************** ****@posting.go ogle.com>...
Greetings folks,

Just curious if anyone knows what the following would produce:
SELECT
MAX( ECP_SUPPORT_DED _EMAIL.CD_TYP_C MPGN) CD_TYP_CMPGN,
MAX(ECP_SUPPORT _DED_EMAIL.CELL _ID) CELL_ID,
ECP_SUPPORT_DED _EMAIL.CLIC_CUS T_ID CUSTID,
MAX( ECP_SUPPORT_DED _EMAIL.ADDRESS) CONTACTED_PARTY ID,
MAX( ECP_SUPPORT_DED _EMAIL.CONTACTE D_PARTY_ID_TYPE )
FROM
ECP_SUPPORT_DED _EMAIL
group by CUSTID

For a given CUSTID, and assuming all fields are character and there
are duplicates, will it randomly select the MAX value of any of these
fields across duplicates, or will it randomly select a custID and
retain that row's attributes with integrity?

thanks!
Jack


First there is nothing RANDOM about it.

MAX() returns the largest value of the COLUMN.

so for mytable:
cmpgn cell custid
xxxx abc 234
aaaa xyz 234

select max(cmpgn), max(cell), custid
from mytable group by custid ;

returns
max(cmpgn) max(cell) custid
xxxx xyz 234

hth,
ed
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

56
3762
by: Xah Lee | last post by:
What are OOP's Jargons and Complexities Xah Lee, 20050128 The Rise of Classes, Methods, Objects In computer languages, often a function definition looks like this: subroutine f (x1, x2, ...) { variables ... do this or that }
145
8859
by: Mark Johnson | last post by:
Oddly enough, I found it difficult, using Google, to find a list of best-of sites based on the quality of their css packages. So I'd ask. Does anyone know of particularly good sites which are in good measure because of their creative and useful css designs? I'm aware of Zen Garden and a few others. So don't bother with those. And I hope I don't get replies from people with a 'tin ear' and no design sense. Good sites. Good pages. That's...
3
1910
by: Skyhorse | last post by:
What are the following codes doing? What are the meaning of & 0xffe00000, & 3, 0xf, 0x3? Is there any difference between & 3 and & 0x3? inline BOOL CheckAudioHeader(DWORD dwHeader) { if ( (dwHeader & 0xffe00000) != 0xffe00000) return FALSE; if (!((dwHeader >> 17) & 3)) return FALSE;
5
1728
by: Corrine | last post by:
Given a backend on a network server and a frontend on a local computer, when is data pulled across the network? For example, does Rst.Recordcount pull data across the network? How about Rst.Findfirst? When a form or report opens, do they pull all the data in the recordsource across the network? Thank you for your help! Corrine
24
2790
by: Bob Alston | last post by:
Most of my Access database implementations have been fairly small in terms of data volume and number of concurrent users. So far I haven't had performance issues to worry about. <knock on wood> But I am curious about what techniques those of you who have done higher volume access implementations use to ensure high performance of the database in a multi-user 100mbps LAN implementation??? Thanks
5
19845
by: John | last post by:
I came across this nugget in my intarweb travels. It's part of a median-calculation. Can someone tell me what the if( length & 0x1 ) is doing? Thanks! --------------------------------------------- /* Is vector length odd or even ? */ if (length & 0x1) ans = pCopy;
2
5683
by: Earl Teigrob | last post by:
I am using C# to program ASP.NET. I am using class of static fields to hold all variables that are common to the application, and I am sure that this is fine. However, I was also using some static fields to hold values that calculated every time a user opens a page (unique to each session). These static fields are used in other classes thoughout the application. However, it suddenlly struck me that these static fields are (i think) common...
4
20640
by: Raja Chandrasekaran | last post by:
Hai friends, I really wonder, If the interface does not have any definition, Y do we need to use interface. You can then only we can use Multiple inheritance. I really cant understand, Just for declararion y do we need to use interface. Anyhow the method name and definition ll be in the derived class. Instead of that we can do all code in the derived class itself right...? Then y these concept came. If anybody know, please explain me...
9
2691
by: Cao Yi | last post by:
Hi, here's a fract of codes, and what's the line "scanf("%lf%*", &cvi)" doing? ============================= do { printf("\nCoefficient: "); scanf("%lf%*", &cvi); getchar(); } while (cvi <= 0.0);
3
2996
by: Nathan Sokalski | last post by:
I have an UpdatePanel that needs to maintain the value of several TextBoxes with TextMode=Password. Since the browser clears all password fields client-side, I obviously need to use JavaScript to do this. Can someone help me? Thanks. Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10104
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9912
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.