Solved

if value is already in the second table do not select

Posted on 2013-12-19
2
208 Views
Last Modified: 2013-12-20
profile_id is varchar

SELECT profile_id
            FROM a_messages
            WHERE

where profile_id is NOT in profiles
so profiles.profile_id does not exist

because if the value is already profiles table, there is no need to use it
0
Comment
Question by:rgb192
2 Comments
 
LVL 8

Accepted Solution

by:
vr6r earned 500 total points
ID: 39730381
SELECT a_messages.profile_id
FROM a_messages
LEFT JOIN profiles on profiles.profile_id = a_messages.profile_id
WHERE profiles.profile_id IS NULL

Open in new window

0
 

Author Closing Comment

by:rgb192
ID: 39733166
thank you
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (http://dev.mysql.com/doc/refm…
This guide whil teach how to setup live replication (database mirroring) on 2 servers for backup or other purposes. In our example situation we have this network schema (see atachment). We need to replicate EVERY executed SQL query on server 1 to…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

832 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