Repository: apache/shardingsphere
Issue: SS 3.1.0.M1 count sql throw an error,3.1.0 works well

## Bug Report

**For English only**, other languages will not accept.
With the Configration #1653 

The sql throw an exception with 3.1.0.M1
and works well with 3.0.0
```sql
SELECT COUNT(1) FROM ( 
     SELECT
        r.`channel` as `channel_code`,
        r.`channel_name` as `channel_name`,
        COUNT(r.id) `total_cnt`,
        COUNT(r.connect_flag = "Y") `connected_cnt`
        FROM record_callin r
        LEFT JOIN sys_org_tree_rel tree ON tree.teamid = r.teamid
        LEFT JOIN sys_user u ON u.brokerid = r.brokerid
        where
        r.create_time >= '2018-01-01 00:00:00' and r.create_time <=  '2019-01-01 00:00:00'
        GROUP BY 
        r.`channel` 
) TOTAL
```

this throws an error:
```
Caused by: java.lang.IllegalStateException: DQL must have sharding column with subquery.
	at com.google.common.base.Preconditions.checkState(Preconditions.java:444) ~[guava-20.0.jar:na]
	at io.shardingsphere.core.routing.router.sharding.ParsingSQLRouter.checkAndMergeShardingValue(ParsingSQLRouter.java:157) ~[sharding-core-3.1.0.M1.jar:na]
	at io.shardingsphere.core.routing.router.sharding.ParsingSQLRouter.route(ParsingSQLRouter.java:127) ~[sharding-core-3.1.0.M1.jar:na]
	at io.shardingsphere.core.routing.PreparedStatementRoutingEngine.route(PreparedStatementRoutingEngine.java:66) ~[sharding-core-3.1.0.M1.jar:na]
	at io.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.sqlRoute(ShardingPreparedStatement.java:241) ~[sharding-jdbc-core-3.1.0.M1.jar:na]
	at io.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.executeQuery(ShardingPreparedStatement.java:111) ~[sharding-jdbc-core-3.1.0.M1.jar:na]
	at com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor.queryTotal(PaginationInterceptor.java:207) ~[mybatis-plus-extension-3.0.6.jar:3.0.6]
	... 116 common frames omitted

```

#1653 reason is I used single quote mark with column alias
but this issue reason is different


Changed files:
sharding-core/src/main/java/io/shardingsphere/core/routing/router/sharding/ParsingSQLRouter.java
sharding-core/src/test/java/io/shardingsphere/core/routing/type/standard/StandardRoutingEngineForSubQueryTest.java

diff --git a/sharding-core/src/main/java/io/shardingsphere/core/routing/router/sharding/ParsingSQLRouter.java b/sharding-core/src/main/java/io/shardingsphere/core/routing/router/sharding/ParsingSQLRouter.java
index 56034c9f339..c6fe888490b 100644
--- a/sharding-core/src/main/java/io/shardingsphere/core/routing/router/sharding/ParsingSQLRouter.java
+++ b/sharding-core/src/main/java/io/shardingsphere/core/routing/router/sharding/ParsingSQLRouter.java
@@ -149,6 +149,9 @@ public final class ParsingSQLRouter implements ShardingRouter {
         if (selectStatement.getSubQueryStatements().isEmpty()) {
             return;
         }
+        if (selectStatement.getTables().isEmpty()) {
+            return;
+        }
         for (AndCondition each : sqlStatement.getConditions().getOrCondition().getAndConditions()) {
             for (Condition eachCondition : each.getConditions()) {
                 Preconditions.checkState(ShardingOperator.EQUAL == eachCondition.getOperator(), "DQL only support '=' with subquery.");
diff --git a/sharding-core/src/test/java/io/shardingsphere/core/routing/type/standard/StandardRoutingEngineForSubQueryTest.java b/sharding-core/src/test/java/io/shardingsphere/core/routing/type/standard/StandardRoutingEngineForSubQueryTest.java
index 1f15d291453..d7cb21b876a 100644
--- a/sharding-core/src/test/java/io/shardingsphere/core/routing/type/standard/StandardRoutingEngineForSubQueryTest.java
+++ b/sharding-core/src/test/java/io/shardingsphere/core/routing/type/standard/StandardRoutingEngineForSubQueryTest.java
@@ -67,6 +67,15 @@ public final class StandardRoutingEngineForSubQueryTest {
         assertSubquery(sql, parameters);
     }
     
+    @Test
+    public void assertUnshardingTalbe() {
+        String sql = "select (select max(id) from t_user b where b.id = ?) from t_user a where id = ? ";
+        List<Object> parameters = new LinkedList<>();
+        parameters.add(1);
+        parameters.add(1);
+        assertSubquery(sql, parameters);
+    }
+    
     public void assertSubquery(final String sql, final List<Object> parameters) {
         ShardingRule shardingRule = createShardingRule();
         ShardingTableMetaData shardingTableMetaData = buildShardingTableMetaData();