Jump to content

Help with a query


vioravis

Recommended Posts

I have two tables Table A and Table B as follows:

 

Table A

Day

1

2

3

4

 

Table B

DayCount

2

1

2

3

4

I want to create a resulting table (Table C) such a way that Table contains the number of times the value in Table B exceeds each row in Table A.

 

Table C

Day  Count

1          5

2          4

3          3

4          2

 

The first column of Table C is from Table A. The second column contains how many in Table B exceeds the column Day. For example, 5 days have value greater than 1 (in Table B). 4 days have value greater than 2 in Table B and so on.

 

Can someone please help me with the appropriate query??

 

Thank you.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.