I have two tables

Table1

```
ID   SID    Date        value
1    1  2017-12-31  22.36
1    1  2018-03-31  20.0
1    1  2018-06-30  10.87
1    1  2018-09-30  67.98
1    2  2017-12-31  55.987
1    2  2018-03-31  60.12
1    2  2018-06-30  62.0
1    2  2018-09-30  15.543
1    3  2017-12-31  85.987
1    3  2018-03-31  40.12
1    3  2018-06-30  12.0
1    3  2018-09-30  15.543

```

Table2

```
ID  SID     Date        value
2    1  2017-12-31     22.36
2    1  2018-03-31     10.0
2    1  2018-06-30     10.87
2    1  2018-09-30     67.98
2    2  2017-12-31     55.987
2    2  2018-03-31     60.12
2    2  2018-06-30     31.0
2    2  2018-09-30     15.543
2    3  2017-12-31     85.987
2    3  2018-03-31     40.12
2    3  2018-06-30     06.0

```

Table1 is the base table.

Table1 and Table2 contain quarterly data,SID is common in these two tables.

I am trying to achieve :

* To find out the percentage of decrease/increase in values column of
respective SID's of Table1 and Table 2.if SID of Table1 and Table2 is
missing then a show a message.

below is the expected result

```
ID   SID    Date        value     percent increase/decrease
1    1    2017-12-31    22.36     0
1    1   2018-03-31    20.018     50
1    1   2018-06-30    10.87      0
1    1   2018-09-30    67.98      0
1    2   2017-12-31    55.987     0
1    2   2018-03-31    60.12      0
1    2   2018-06-30    31.0       50
1    2   2018-09-30    15.543     0
1    3   2017-12-31    85.987     0
1    3   2018-03-31    40.12      0
1    3   2018-06-30    12.0       50
1    3    2018-09-30  15.543     data not available to compare in table 2

```

is this achievable ? 
I am trying to write a query to achieve this by JOIN however nowhere near to it. below is the sample query.

```
 SELECT t1.ID,t1.SID,t1.Date,t1.value,
 CASE WHEN (t1.Value -t2.Value/t1.value)*100=50 THEN '50'  END AS 'percent increase/decrease'
 FROM table t1 INNER JOIN table t2 
 ON t1.SID=t2.SID   

```

any hints/idea on this?

Thanks!