RRN and JOIN…

15 pts.
Tags:
JOIN statement
RRN
I have two files and I'd like to join and make a group-by on a xycod, in order to count the number of occurrences. This is the question: What happens on the RRN filed when i try to do group by statement? There is one-to-many relation between records and RRNs, so which is the RRN assigned to it?

Answer Wiki

Thanks. We'll let you know when a new response is added.

I’n not sure what you are doing.
Sounds like you are doing an SQL join.
Why does the RRN matter?
If it’s so you can determine the XYCOD wouldn’t this statement do it?

Select count(*), a.XYCOD
from tablea a join tableb b
on a.XYCOD = b.XYCOD
group by XYCOD

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Devilva
    yes, i'm doing a SQL join...and ok, the role of RRN is not relevant to obtain the result of statement. it's a conceptual curiosity only... infact there are many "one-to-many" relation between records and RRNs, and i'd like to know which is the RRN assigned... for example max(RRN(<file>)) ...
    15 pointsBadges:
    report
  • philpl1jb
    Well, I think they have created a temp file so the RRN's of that file would have no relationship to either parent file.
    49,980 pointsBadges:
    report
  • TomLiotta
    for example max(RRN(<file>)) For that example, it would be the highest record number in <file>. For GROUP BY operations, you can't reasonably retrieve RRN() in the SELECT list because it's a scalar function. Only aggregate functions may be used in a GROUP BY result set field list, e.g., SUM() and MAX() or MIN(). To use it on by itself, it would also need to be specified in the GROUP BY clause which would make the GROUP BY clause meaningless since each RRN() value will be unique. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following