Search
 
SCRIPT & CODE EXAMPLE
 

SQL

subquery in sql

SELECT column_name
 FROM table_name1
WHERE VALUE IN 
(SELECT column_name
FROM table_name2 
WHERE condition)
Comment

SQL Subquery

SELECT *
FROM Customers
WHERE age = (
  SELECT MIN(age)
  FROM Customers
);
Comment

what is subquery in sql

SUBQUERY IS NESTED QUERY INSIDE A SELECT, 
INSERT OR UPDATE METHODS. OR INSIDE ANOTHER SUBQUERY
Comment

sql subquery

SELECT name, listed_price
FROM paintings
WHERE listed_price > (
    SELECT AVG(listed_price)
    FROM paintings
);
Comment

subquery in sql

UPDATE dataflair_emp1 
SET salary=35000
WHERE emp_id  = ( SELECT emp_id
                    FROM dataflair_emp1
                    WHERE post='Sr.Manager');     
select * from dataflair_emp1;
Comment

subquery sql

UPDATE Book SET note= 'editore: ' + (SELECT name FROM Publisher WHERE Publisher.ID = Book.publisher)
Comment

subquery in sql

DELETE FROM dataflair_emp1
WHERE emp_id IN ( SELECT emp_id
                   FROM dataflair_emp2
                   WHERE age=25);  
select * from dataflair_emp1;
Comment

why we use subquery in sql

We use subquery in order to get aggregate value in column without grouping data
Comment

PREVIOUS NEXT
Code Example
Sql :: mysql select random rows large table 
Sql :: postgresql create user roles 
Sql :: mysql copy data from one table to another 
Sql :: Insufficient memory to excute the sql query 
Sql :: mysql show create db 
Sql :: mysql multiply 
Sql :: alter table name including schema 
Sql :: order by postgres 
Sql :: what is table in sql 
Sql :: mql4 sleep 
Sql :: mysql foreign key 
Sql :: sql injection 
Sql :: update table sql 
Sql :: sql is null or empty 
Sql :: create a table 
Sql :: sql less than operator 
Sql :: mysql error 1452 
Sql :: create domain sql 
Sql :: with transaction.atomic(): 
Sql :: where keyword sql 
Sql :: duplicate a column in sql 
Sql :: mysql client onnection error 
Sql :: drop all tables db2 
Sql :: Which SQL statement would you use to remove a view called EMP_DEPT_VU from your schema? 
Sql :: SQL MAX() and MIN() with Strings 
Sql :: contraint default SQL 
Sql :: fetching data from mysqldb 
Sql :: sql server search all databases for objects 
Sql :: T-SQL - Where Used List (Table/View) 
Sql :: add plugins to mysql workbench 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =