Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 43504

All versions of MySQL (not Microsoft SQL Server). Please also add a version-specific tag like mysql-5.7 if that is relevant to the question.

6 votes

How to insert values into a table from two different tables?

The easiest way you can do this is using sub queries: INSERT INTO classroom(teacher_id,student_id) VALUES ((SELECT id FROM students WHERE s_name='sam'), (SELECT id FROM teacher WHERE t_name='david …
user63762453's user avatar
11 votes
Accepted

what is '#' in create table statement?

Temporary tables are available in MySQL version 3.23 onwards. If you use an older version of MySQL than 3.23, you can't use temporary tables, but you can use heap tables. …
user63762453's user avatar
0 votes

SQL - query multiplying records returned - Cartesian Product

Cartesian product of two tables multiplies every row with every other row which should not happen.I would explain this using this example. You can see that result is somewhat undesired as some of th …
user63762453's user avatar
1 vote

How do I extract row/column elements from multiple tables with same schema in single query

Simplest way would be to use UNION: SELECT * FROM A UNION SELECT * FROM B UNION SELECT * FROM C or use a JOIN: SELECT * FROM A FULL OUTER JOIN B ON < A.name=B.name>; Read more about jo …
user63762453's user avatar