Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MySQL: Get results from one table only

Posted on 2014-02-17
1
Medium Priority
?
263 Views
Last Modified: 2014-02-17
This returns every column twice!  
SELECT * FROM promos.elqBooks_new t1 LEFT JOIN promos.elqBooks t2 ON t1.isbn = t2.isbn WHERE t2.isbn IS NOT NULL LIMIT 1

Open in new window

I only want the results from the table `promos.elqBooks_new`
0
Comment
Question by:hankknight
1 Comment
 
LVL 44

Accepted Solution

by:
Chris Stanyon earned 2000 total points
ID: 39865220
You need to select from the specific table alias:

SELECT t1.* FROM promos.elqBooks_new t1 LEFT JOIN promos.elqBooks t2 ON t1.isbn = t2.isbn WHERE t2.isbn IS NOT NULL LIMIT 1

Open in new window

0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question