Skip to Content
author's profile photo Former Member
Former Member

Hana Sql script help needed

Hi guys,

I am new to HANA . I have got a requirement .Please help me with below issue.

I have a table "ABC"

ABC

COUNTRY REGION REGION ID USA WEST 100 USA NORTH 700 USA NORTH EAST 700

Now there is another table DEF

REGION ID COUNTRY PROFIT REVENUE 600 USA 100 200 650 USA 50 150 200 UK

50

150 100 APAC 100 250

Now the requirement is

IF "REGION ID" FROM TABLE ABC is 700 then fetch values from table DEF which has REGION ID =600 OR 650 ,and COUNTRY FROM table ABC= COUNTRY from TABLE DEF,and sum (profit+revenue) from table DEF.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Aug 23, 2016 at 04:22 PM

    Are there any combinations other than 700-600,650.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 23, 2016 at 04:41 PM

    Is this an interview question? I only ask because sum(profit+revenue) satisfies absolutely no functional requirement that I can think of! 🤪

    Please demonstrate how you would want to see the output.

    Michael

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.