Top "Subquery" questions

"subquery" is vague SQL terminology, used to describe when there's either more than one `SELECT` statement in a query, or when used in Data Manipulation Language (DML) statements (IE: DELETE, UPDATE, INSERT, MERGE).

sql server sub query with a comma separated resultset

I need to return records on a table and my result set needs to contain a comma separated list. I …

sql sql-server join subquery
JPQL / QueryDSL: join subquery and get aliased column

I'm trying to get an average for a count on a groupBy by joining with a subquery. Don't know if …

subquery jpql querydsl
spring-data subquery within a Specification

Spring-data, Oliver Gierke's excellent library, has something called a Specification (org.springframework.data.jpa.domain.Specification). With it you can …

spring subquery criteria-api spring-data
Mysql Inner join with OR condition?

I have 2 tables like below location_distance ---------------------------------------------- id | fromLocid | toLocid | distance ---------------------------------------------- 1 | 3 | 5 | 70 2 | 6 | 8 | 15 3 | 2 | 4 | 63 ... other_table -------------------------------------------- Id | fromLocid | toLocid | otherdata …

mysql subquery inner-join
Using SQL to compare counts of identifiers from two tables

I'm trying to construct a query that compares two tables with identical structure Table 1: ID | Data Table 2: ID | Data ID …

mysql sql subquery correlated-subquery
MySQL Subquery LIMIT

As the title says, I wanted a workaround for this... SELECT comments.comment_id, comments.content_id, comments.user_id, …

mysql subquery
How to get file extension of file as a result of sql query?

I have a table named datas and I'm executing a query like this: SELECT linkurl AS DOWNLOADURL, lastrevlevel AS VERSION, …

mysql sql subquery dao
Hibernate Criteria With Property Not In (Subquery)

I want to execute query something like Select id, name from information where name not in (select firstname from contact …

hibernate subquery hibernate-criteria
Difference between WITH clause and subquery?

What is the difference between WITH clause and subquery? 1. WITH table_name as ( ... ) 2. select * from ( select curr from tableone t1 …

sql oracle subquery common-table-expression
What's wrong with this MySQL query? SELECT * AS `x`, how to use x again later?

The following MySQL query: select `userID` as uID, (select `siteID` from `users` where `userID` = uID) as `sID`, from `actions` where `…

sql mysql subquery in-subquery