calculation at database level

pts.
Tags:
Development
Software Quality Assurance
Software testing
SQL
T-SQL
Hi! I will really appreciate help. Please take a look at few rows of one table . MBRNO Readmit READMIT DATE READMIT Readmit Seq. NO DISCHARGE date NO. of days 121 1 20030101 20030105 5 2 20030105 20030115 10 3 20030202 20030218 3 4 20030218 20020220 0 The measure is count of cases. I do not want to calculate the case with readmit no of days = '0'. Also, discharge date of seq # 1 is same as readmit date of seq # 2. So I need to count either first or 2nd row. So actual count of cases for this member is 2 ( though it appears as 4). How will I achieve it at database level? I will appreciate the help. Thanks a lot.

Answer Wiki

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

Hi Meenac,
check this.
select count(*) from <table>
where date of seq1 = date of seq2 and
readmit no of days = ’0′.

Prashanth,

Discuss This Question:  

 
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

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