SQLTeam.com | Weblogs | Forums

How to extract common values from each archives?


#9

Gotcha Jeff

Thanks


#10

Heh.... doesn't matter if you know me or not... doesn't matter who would say such a thing... they would be correct in the observation that the code was hardcoded for just one scenario instead of all scenarios that the data could manifest itself as. :wink:

I do thank you for the very nice compliment but it's just code and I don't look at things so differently as others. Look at what @jeffw8713 posted for this problem for immediate proof of that.


#11

While I was typing, it appears that I came up with the exact same code as what @jeffw8713 did. He also came up with an anticipated/unspoken but likely requirement of needing to return the whole rows that met the need. Nicely done.


#13

got you Jeff

You love the code !!!!
coding debugging testing PART
all the different things RELATED to code

helping people
:slight_smile:


#14

That's exactly correct. The other "Jeff" on this thread appears to be of the same ilk.

And thank you very much for taking my comments the right way. A whole lot of people don't. They're only meant to teach and are never meant as ad hominem attacks.


#15

Great and thanks
this solution is perfect and yes
PRESID and IDEMITT is the table index.
Thanks again JeffModen


#16

Thank you for the feedback on all of that but I can't take all of the credit here. Although we were suffering from proverbial "ships passing in the night", @jeffw8713 did actually post the very same solution first. It turns out that I actually know him and have had several discussions with him in the past. He's one smart cookie.


#17

hi

i know this has been given as a solution ....

I can think of a scenario where data would break this
Please correct me if i am wrong
:slight_smile:
:slight_smile:

SELECT IDEMITT
FROM #ARCHPRES
GROUP BY IDEMITT
HAVING COUNT(IDEMITT) = (SELECT COUNT(DISTINCT PRESID) FROM #ARCHPRES)
;

i mean dups for the same id 1

Overall Counts Match
but result incorrect

PRESID            IDEMITT
1                          44
                           44
2 ...................... nothing here 
3                        44
4                        44
5                        44
6                       44

i think this can be resolved by
HAVING COUNT(distinct IDEMITT) =


#18

Good thinking and I absolutely agree. That's why I said in my writeup when I posted my code that I assumed that the combination of PRESID and IDEMITT did form UNIQUE pairs (and that implies an index to enforce it) and that the code would break if that weren't true. The OP did come back after I posted my code and stated that the index I implied of did, in fact, exist. If it didn't, then we'd have to do like you said.


#19

Wow Jeff^2.
The Titans
JEFF X 2


#20

Thank you for the kind words (I'm humbled) but I'm no "Titan"... I'm just a fellow that has made more mistakes than most and figured out how to fix my mistakes and pass that on to others. :smiley:


#21

Thank you for the kind words (I'm humbled) but I'm no "Titan"... I'm just a fellow that has made more mistakes than most and figured out how to fix my mistakes and pass that on to others. :smiley:

Nice words Jeff
Like your humility

I totally agree with you
:slight_smile:
:slight_smile:


#22
Wow Jeff^2.
The Titans
JEFF X 2

yosiasz

Want to become a TITAN
very very easy !!!

!!!!! ANYONE CAN

:slight_smile:
:slight_smile:
24 hrs day 365 days a year


#23

Once you become an "expert", the best advice I can give you is to realize you're not. Becoming an "expert" isn't the end of the game. It simply means that you're more qualified to learn more about the subject, whatever that subject is, and that the game is really just beginning. :wink: There is no way to "Become an expert QUICKLY".

https://www.google.com/search?q=impostor+syndrome+dunning+kruger


#24

hi Jeff

What I had in mind is something like the old TV Show "THE PRETENDER"
the idea concepts have been around a long long long time

the thing is THERE is an EXPLOSION of new FIELDS
and lot of INTERSECTIONS AND CROSS SECTIONS
hence the need for
.....................TIME to Master .................
and give solutions
needs to be reduced DRASTICALLY

DARPA and IARPA and lot of other people
are working on this
:slight_smile:
:slight_smile:

DARPA

IARPA


#25

hi jeff

:wink: :slight_smile:

here is another thing ..

where .. your memory is in state of something

lets say i wanted pick up all your knowledge and experience and everything else

i would just translate your mind in to mine ..
with the help of some instrument or whatever

my mind would "instantaneously" capture you


#26

That's what I mean

Anyone ... Any one
can become SQL expert
Quickly

Or

Instantly

:grinning::grinning:


#27

Heh... you have to remember that they might be programmed by idiots :smiley: or by people that think they should be idiots or a smattering of both. The U.S. news channels seem to be working on the latter and it appears to be working on most of the populace. :D:D:D


#28

thanks jeff
:slight_smile:

more than anyhting would like to njoy
chatting with you

Looks like you like SQL
i will be there pretty soon
We can have some FUN

`

`Heh... you have to remember that you might be programmed by idiots.

`this concept is also there

people's BIASes
all different kinds

they program thier biases ,,,

:slight_smile:
:slight_smile:


#29

Correct... my bias is "Make it work, make it fast, make it pretty and it ain't done 'til it's pretty".

The bias I most frequently come across from others is "I just want to get it off my plate and I don't care how" or "I'm an expert. My 30 years of saying so makes it true."