Try this query:
INSERT INTO C (aID, bID)
SELECT A.ID, B.ID
FROM A, B
WHERE A.Name="Me"
AND B.Class="Math";
More Related Contents:
- i have an error which i dont understand. can you help me? [closed]
- In SQL Server how to get the count of child if both parent and child are available [closed]
- Rank function in MySQL
- MySQL select 10 random rows from 600K rows fast
- Get a list of dates between two dates
- Calculate a running total in MySQL
- Find nearest latitude/longitude with an SQL query
- Simulate lag function in MySQL
- Get record counts for all tables in MySQL database
- How do I check if a column is empty or null in MySQL?
- Use MySQL spatial extensions to select points inside circle
- Subqueries with EXISTS vs IN – MySQL
- What is this operator in MySQL?
- MySQL create stored procedure syntax with delimiter
- 60 million entries, select entries from a certain month. How to optimize database?
- Is it possible to GROUP BY multiple columns using MySQL?
- MySQL monthly Sale of last 12 months including months with no Sale
- How to find non-existing data from another Table by JOIN?
- MySQL/SQL: Update with correlated subquery from the updated table itself
- MySQL #1093 – You can’t specify target table ‘giveaways’ for update in FROM clause
- Calculating a Moving Average MySQL?
- Strings as Primary Keys in MYSQL Database [closed]
- MySQL : ERROR 1215 (HY000): Cannot add foreign key constraint
- Select data from “show tables” MySQL query
- What is dynamic SQL?
- MySql. How to use Self Join
- SQL doesnt differentiate u and ü although collation is utf8mb4_unicode_ci
- How to select non “unique” rows
- Deleting a row based on the max value
- MySQL Multiple Joins in one query?