?
Solved

Sql query with join

Posted on 2011-10-05
2
Medium Priority
?
320 Views
Last Modified: 2012-08-13
Hi,
Need to create a query with following selection criteria
1.Select * from tableA,tableB where tableA.refno = tableB.refno and  tableB.Cu_track_lg_datadate is null
2.Also include members who do not have tableB

Cheers
0
Comment
Question by:RIAS
2 Comments
 
LVL 22

Accepted Solution

by:
pivar earned 2000 total points
ID: 36916119
Hi,

Seams like you need a left join, try

select * from tableA
left join tableB on tableA.refno = tableB.refno
where tableB.Cu_track_lg_datadate is null or tableB.refno is null

/peter

0
 

Author Closing Comment

by:RIAS
ID: 36916164
Cheers mate!!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Suggested Courses

840 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