Avatar of LZ1
LZ1Flag for United States of America

asked on 

Query repeating results and should not

Hey Experts!!
I have a query (below) that is returning results numerous times and shouldn't be.  This a very straightforward query.  

AED_Master.AED_no is key in the main table
AED_Master.serial_code does not have duplicates

Can someone help?
SELECT AED_Master.serial_code, AED_Master.placement, Cat_Sub.Subgroup, Models.Model
FROM AED_Master, Client, Cat_Sub, Models 
WHERE AED_Master.Model_ID = 26
AND Cat_Sub.Category = "School"
AND Client.CatSub_ID = Cat_Sub.CatSub_ID;

Open in new window

SQL

Avatar of undefined
Last Comment
Guy Hengel [angelIII / a3]
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of LZ1
LZ1
Flag of United States of America image

ASKER

So then I would have to use like an INNER JOIN or LEFT JOIN and write the query that way?
it's not "required", you could also use simple WHERE conditions to do the same.
however, writing JOINs will make it much clearer in the query how the tables are related...
SQL
SQL

SQL (Structured Query Language) is designed to be used in conjunction with relational database products as of a means of working with sets of data. SQL consists of data definition, data manipulation, and procedural elements. Its scope includes data insert, query, update and delete, schema creation and modification, and data access control.

61K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo