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
https://forums.phpfreaks.com/topic/251419-help-with-a-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.