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
Related Posts:
- How do I UPDATE from a SELECT in SQL Server?
- SQL SELECT WHERE field contains words
- SQL SELECT WHERE field contains words
- SQL SELECT WHERE field contains words
- ORA-01843 not a valid month- Comparing Dates
- Best way to do nested case statement logic in SQL Server
- How to write a SQL DELETE statement with a SELECT statement in the WHERE clause?
- SQL conditional SELECT
- DATEDIFF function in Oracle
- MySQL error: Unknown column in ‘where clause’
- Postgresql column reference “id” is ambiguous
- How to order by column A and then by column B?
- Help me SELECT thumbnail from SQL and use
- how to SELECT meta values that are not null?
- What is a stored procedure?
- Unknown column in ‘field list’ error on MySQL Update query
- SQL Inner-join with 3 tables?
- Conversion failed when converting date and/or time from character string while inserting datetime
- MySQL create table if not exists and insert record only if table was created
- error, string or binary data would be truncated when trying to insert
- How can I do an UPDATE statement with JOIN in SQL Server?
- ORA-00907: missing right parenthesis
- Rename column SQL Server 2008
- Why do we need “Relationships” between tables at all?
- Using group by on multiple columns
- How to declare a variable in MySQL?
- Drop a temporary table if it exists
- How do I escape a single quote in SQL Server?
- ORA-00918: column ambiguously defined in SELECT *
- Teradata: how to convert varchar value (format ‘dd.mm.yyyy’) to date (format ‘yyyy-mm-dd’ )?
- How Stuff and ‘For Xml Path’ work in SQL Server?
- Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
- Oracle SELECT TOP 10 records
- must appear in the GROUP BY clause or be used in an aggregate function
- How can I return pivot table output in MySQL?
- Compare dates in MySQL
- The multi-part identifier could not be bound
- MySQL syntax for Join Update
- SQLite – UPSERT *not* INSERT or REPLACE
- how to drop partition without dropping data in MySQL?
- Simple way to calculate median with MySQL
- The ALTER TABLE statement conflicted with the FOREIGN KEY constraint
- Error 1046 No database Selected, how to resolve?
- What is it exactly a BLOB in a DBMS context
- How do I do multiple CASE WHEN conditions using SQL Server 2008?
- Insert text with single quotes in PostgreSQL
- SQL Server IF NOT EXISTS Usage?
- How to insert date values into table
- Arithmetic overflow error converting numeric to data type numeric
- I want to use CASE statement to update some records in sql server 2005
- Simulate CREATE DATABASE IF NOT EXISTS for PostgreSQL?
- SELECT DISTINCT on one column
- how to remove time from datetime
- TSQL PIVOT MULTIPLE COLUMNS
- MySQL – UPDATE multiple rows with different values in one query
- How to create a MySQL hierarchical recursive query?
- Microsoft OLE DB Provider for SQL Server error ‘80004005’
- Query to convert from datetime to date mysql
- Equivalent of Oracle’s RowID in SQL Server
- Is there a Max function in SQL Server that takes two values like Math.Max in .NET?
- Best way to test if a row exists in a MySQL table
- Subtract one day from datetime
- Get current year in TSQL
- Is it possible to specify condition in Count()?
- SQL Server: Make all UPPER case to Proper Case/Title Case
- using sql count in a case statement
- How do I query for all dates greater than a certain date in SQL Server?
- Backup a single table with its data from a database in sql server 2008
- updating table rows in postgres using subquery
- Temporary table in SQL server causing ‘ There is already an object named’ error
- MySQL OPTIMIZE all tables?
- MySQL INSERT INTO table VALUES.. vs INSERT INTO table SET
- Is there a coalesce-like function in Excel?
- How do I count unique items in field in Access query?
- Sqlite: CURRENT_TIMESTAMP is in GMT, not the timezone of the machine
- MySQL LIKE IN()?
- Filter data based on date in sql
- What is a postgres superuser
- ora-06553 pls-306 wrong number or types of arguments in call to ‘ogc_x’
- SQL query to extract only the “current” wp_posts?
- prepare() not working
- How to retrieve sticky post in raw sql?
- How to remove in the wordpress database all posts revisions except the last three?
- How do I move a WordPress site to another server?
- Backticks (`) Instead of Single Quotes (‘) in an SQL Statement?
- $wpdb get_var issue
- WP Optimization: Removing Orphaned wp_options (especially the autoload ones)
- Auto-update tables from database
- Inserting rows into a custom table, when plugin is activated
- dbDelta not creating table (yes, once more)
- Posts modified in the last 48 hours
- post id not displaying
- How to export 2 week’s worth of posts
- Nested select statements not working
- blank page after update my theme
- Insert multiple checkbox values
- How to get EVENT based on startday, using BETWEEN
- wpdb prepare without placeholder
- This SQL request call all time and overload my server : SELECT meta_value FROM wp_sitemeta WHERE meta_key = ‘wp_installer_network’ AND site_id = 1
- Deleting the MySQL database