diff --git a/sbroad-core/src/frontend/sql.rs b/sbroad-core/src/frontend/sql.rs
index e45a62dcbcb02b4c069c3f6b207fa47f927dc89c..f30abf7eaf23e721486d9043321713ba09346b78 100644
--- a/sbroad-core/src/frontend/sql.rs
+++ b/sbroad-core/src/frontend/sql.rs
@@ -267,24 +267,7 @@ impl Ast for AbstractSyntaxTree {
                         )
                     })?;
                     let plan_child_id = map.get(*ast_child_id)?;
-                    let alias_name: Option<String> = if let Some(ast_name_id) = node.children.get(1)
-                    {
-                        let ast_alias = self.nodes.get_node(*ast_name_id)?;
-                        if let Type::SubQueryName = ast_alias.rule {
-                        } else {
-                            return Err(SbroadError::Invalid(
-                                Entity::Type,
-                                Some(format!(
-                                    "expected a sub-query name, got {:?}.",
-                                    ast_alias.rule
-                                )),
-                            ));
-                        }
-                        ast_alias.value.as_deref().map(normalize_name_from_sql)
-                    } else {
-                        None
-                    };
-                    let plan_sq_id = plan.add_sub_query(plan_child_id, alias_name.as_deref())?;
+                    let plan_sq_id = plan.add_sub_query(plan_child_id, None)?;
                     sq_nodes.push(plan_sq_id);
                     map.add(id, plan_sq_id);
                 }
@@ -1049,7 +1032,6 @@ impl Ast for AbstractSyntaxTree {
                 | Type::Multiply
                 | Type::ScanName
                 | Type::Select
-                | Type::SubQueryName
                 | Type::Subtract
                 | Type::InnerJoinKind
                 | Type::LeftJoinKind
diff --git a/sbroad-core/src/frontend/sql/ast.rs b/sbroad-core/src/frontend/sql/ast.rs
index c3a35f3e8be7cba0b0c234c1f2b5bd1e51a2eac5..f783f9e90737ea4526cbd42b7258eb798da49358 100644
--- a/sbroad-core/src/frontend/sql/ast.rs
+++ b/sbroad-core/src/frontend/sql/ast.rs
@@ -85,7 +85,6 @@ pub enum Type {
     Selection,
     String,
     SubQuery,
-    SubQueryName,
     Subtract,
     Table,
     TargetColumns,
@@ -261,7 +260,6 @@ impl fmt::Display for Type {
             Type::Selection => "Selection".to_string(),
             Type::String => "String".to_string(),
             Type::SubQuery => "SubQuery".to_string(),
-            Type::SubQueryName => "SubQueryName".to_string(),
             Type::Subtract => "Subtract".to_string(),
             Type::Table => "Table".to_string(),
             Type::TargetColumns => "TargetColumns".to_string(),