473,387 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to return all records (linked and not linked) in the query?

91
Hi,

I have two tables, [Rules] and [Process] which are in a many to many relationship via a junction table[JRule_Process]. It has the following field (relevant ones for this discussion):

[Rules]
RuleID
RuleName

[Process]
ProcessID
ProcessName

[JRule_Process]
JunctionID
RuleID
ProcessID


I have almost 5000 unique [RuleName] and around 100 [Process Name]. Currently, only some of the rules are mapped with processes.
When I am designing a query with the following fields, [RuleName] and [ProcessName], it is only returning results where there is a mapping between the two tables.

What I also want is to see all the records for RuleName where the ProcessName is missing.

How do I design the query so that I can see all records where [ProcessName] is mapped to a [RuleName] and also where it is not ?

Kindly advise.

Many thanks.
Apr 24 '12 #1

✓ answered by beacon

Have you created a left outer join between the [Rules] table and the [JRule_Process] table, then create a left outer join between the [JRule_Process] table and the [Process] table?

This will show every record from the [Rules] table no matter what and only those records from the [Process] table where you've established a link.

Hope this helps,
beacon

2 1208
beacon
579 512MB
Have you created a left outer join between the [Rules] table and the [JRule_Process] table, then create a left outer join between the [JRule_Process] table and the [Process] table?

This will show every record from the [Rules] table no matter what and only those records from the [Process] table where you've established a link.

Hope this helps,
beacon
Apr 24 '12 #2
sg2808
91
Awesome. It works. Thank you so much.
Apr 25 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: John | last post by:
I've got a single table I need to query to return records that have no "related records." Table dataset example: 1. John, Biology 2. Dave, Math 3. Susan, Biology 4. Betty, Sociology The...
1
by: geronimo_me | last post by:
Hi, I have a query that has the following fields: Business: ID Number: LastName: EmpNo: Hours1: Hours2:
3
by: sdisalvo | last post by:
I'm looking for a way to filter records in a query (or report) based on a value in a field of an adjacent record. Can this be done easily? I cannot find any info in the help files. Thanks
2
by: jmarr02s | last post by:
I don't know what I am doing wrong I get duplicate records when I query Here is my SQL query code: SELECT Utilization_T.Facid, Utilization_T.Year, Utilization_T.Beds, Utilization_T.LicBeds,...
3
by: shades234 | last post by:
I was wondering how to go aboout returning say the last 10 records of a query. the query is just a reproduction of a table. the querey is set up like SELECT fields FROM table ORDER BY...
6
by: klove1209 | last post by:
Good afternoon, Can someone please tell me how I can return records from a query. I have text fields that I need to obtain, and have those necessary records sent to MS Word. I need to return the...
2
JAMBAI
by: JAMBAI | last post by:
Hi, How to delete large numbers (100,000 - 1,000,000) records from linked table. I am trying to delete from MS Access Forms. Thanks Jambai
4
by: Button | last post by:
Ok maybe i'm stupid because i want something really simple and can;t figure it out. I would like to display the number of records in a query on a access form. To be precise i made a database...
3
by: tushar jadhav | last post by:
Suppose, i hv an 10 columns and next to that other columns in a DB Table. That 10 columns hv same default values & others are retriving from other table and are nearly 1000 records. How can i insert...
4
by: paulquinlan100 | last post by:
Hi I have the following query: SELECT qryBlackbook.* FROM qryBlackbook inner JOIN qryLatestMeetingDate ON (qryBlackbook.Site_Ref = qryLatestMeetingDate.Site_Ref) AND...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.