You can do something like this:
(SELECT
name, games, goals
FROM tblMadrid WHERE name="ronaldo")
UNION
(SELECT
name, games, goals
FROM tblBarcelona WHERE name="messi")
ORDER BY goals;
See, for example: https://dev.mysql.com/doc/refman/5.0/en/union.html
More Related Contents:
- Whats wrong in this sql query? It throws error [closed]
- How do I UPDATE from a SELECT in SQL Server?
- SQL update from one Table to another based on a ID match
- SQL join: selecting the last records in a one-to-many relationship
- COUNT(*) vs. COUNT(1) vs. COUNT(pk): which is better? [duplicate]
- SQL SELECT WHERE field contains words
- What is the difference between using a cross join and putting a comma between the two tables?
- Return a value if no record is found
- SQL WHERE ID IN (id1, id2, …, idn)
- How can I select from list of values in Oracle
- Are there any way to execute a query inside the string value (like eval) in PostgreSQL?
- Select TOP X (or bottom) percent for numeric values in MySQL
- Fastest way to determine if record exists
- How to kill a running SELECT statement
- How do I select all the columns from a table, plus additional columns like ROWNUM?
- DATEDIFF function in Oracle [duplicate]
- Best way to do nested case statement logic in SQL Server
- How to select multiple rows filled with constants?
- How to select only the first rows for each unique value of a column?
- How to write a SQL DELETE statement with a SELECT statement in the WHERE clause?
- Why postgres returns unordered data in select query, after updation of row?
- SQL column reference “id” is ambiguous
- SQL SELECT from multiple tables
- Can select * usage ever be justified?
- How to select records without duplicate on just one field in SQL?
- how does SELECT TOP works when no order by is specified?
- Check if two “select”s are equivalent
- SQL: Select rows with a column value that occurs at least N times?
- Finding unmatched records with SQL
- Combine Two Tables in Select (SQL Server 2008)