request for query hint

  • Table 1 : custemaildim

    emailADDr |||||| SendSurvey

    some@gmail.com|||||| N

    exam@gmail.com|||||| y

    test@gmail.com|||||| Y

    Table 2: Unsubscribe

    emailADDr |||||| Sno

    exam@gmail.com |||||| 2

    new1@gmail.com |||||| 2

    Requirement :

    1.Initially passing the email address to custemaildim table to find out the Send Survey Flag.

    So here we will get send survey flag would be Yes or No from the above table.

    2.So we have the send survey flag either Yes or No

    3.Let’s take Send Survey Flag has Yes.

    a.Find the email address exists in unsubscribe table. If it doesn’t have the email address exists in unsubscribe table. Flag return yes flag.

    b.If it does have a email address exists in unsubscribe table return No flag.

    4.Let’s take Send Survey Flag has No.

    a.Here it’s send survey flag is no. We don’t need to look up on the unsubscribe table just return No flag.

    5.If the email address does not exist in the custemaildim table find that email address exist in the unsubscribe table if it has that email Address return NO flag. If it does not exist on both tables then it return YES flag.

  • DBA12345 (12/22/2013)


    Table 1 : custemaildim

    emailADDr |||||| SendSurvey

    some@gmail.com|||||| N

    exam@gmail.com|||||| y

    test@gmail.com|||||| Y

    Table 2: Unsubscribe

    emailADDr |||||| Sno

    exam@gmail.com |||||| 2

    new1@gmail.com |||||| 2

    Requirement :

    1.Initially passing the email address to custemaildim table to find out the Send Survey Flag.

    So here we will get send survey flag would be Yes or No from the above table.

    2.So we have the send survey flag either Yes or No

    3.Let’s take Send Survey Flag has Yes.

    a.Find the email address exists in unsubscribe table. If it doesn’t have the email address exists in unsubscribe table. Flag return yes flag.

    b.If it does have a email address exists in unsubscribe table return No flag.

    4.Let’s take Send Survey Flag has No.

    a.Here it’s send survey flag is no. We don’t need to look up on the unsubscribe table just return No flag.

    5.If the email address does not exist in the custemaildim table find that email address exist in the unsubscribe table if it has that email Address return NO flag. If it does not exist on both tables then it return YES flag.

    This looks like homework, a test, or you simply want us to do your entire job for you. Please give this stuff a try on your own. If you run into a problem, see the first link in my signature line below under "Helpful Links" for how to post the problem you're having.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply