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).

PostgreSQL: Sub-select inside insert

I have a table called map_tags: map_id | map_license | map_desc And another table (widgets) whose records contains …

sql postgresql insert subquery
Hibernate subquery detachedCriteria

How to write a subquery in hibernate which is having multiple subqueries. for example select * from project_dtls where project_…

hibernate subquery detachedcriteria
Mysql ERROR 1241 (21000): Operand should contain 1 column(s)

I have Customer Groups with Number-Ranges (from Customernumber, to Customernumber). select g.id, (select count(*), sum(sales) FROM transactions t1 …

mysql subquery operand mysql-error-1241
Get data from multiple SELECT sub-queries for reporting from MySQL database

I'm trying to achieve is to create one complex query consisting of a few sub-queries. The idea is to give …

mysql subquery
Subquery in select clause with JPA Criteria API

I'm trying, as in title, to insert a subquery in select clause like in this simple SQL: SELECT id, name, (…

jpa select subquery criteria
Is possible to reuse subqueries?

I'm having some problems trying to perform a query. I have two tables, one with elements information, and another one …

sql subquery query-optimization
Return pre-UPDATE column values using SQL only

I posted a related question, but this is another part of my puzzle. I would like to get the OLD …

sql postgresql concurrency sql-update subquery
Hibernate Criteria for "in subselect"

I'm trying to do something like this, but using Criteria instead of HQL: select user from User where user in ( …

hibernate nhibernate subquery criteria
PostgreSQL DELETE FROM (SELECT * FROM table FETCH FIRST 10 ROWS ONLY)

How do I delete only a few rows in postgreSQL? I want to fetch 10 rows to delete in a subquery. …

postgresql subquery sql-delete
The multi-part identifier could not be bound - SubQuery

Schema: create table TableA (A1 int) create table TableB (B1 int, B2 int) create table TableC (C1 int) Problematic query: …

sql sql-server-2008 join subquery inner-join