Horje Website
SQL Insert Statement With Subquery – MYsql Code

SQL Insert Statement With Subquery

SQL Insert Statement With Subquery - SQL Code


 
  1. -- Create premium_customers table like customers then execute this query
  2. INSERT INTO premium_customers
  3. SELECT * FROM customers
  4. WHERE cust_id IN (SELECT DISTINCT cust_id FROM orders WHERE order_value > 5000);



Try Your Self ->



Published:
September 28, 2020
Author:
admin
Category:
SQL Advanced, SQL Source Code
Views:
19

This article was posted in SQL Advanced, SQL Source Code and tagged , , . Bookmark the permalink. Follow comments with the RSS feed for this post.Post a Comment or leave a trackback: Trackback URL.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

Horje © 2011 - 2022