SQL Join and Where Issue

Multi tool use


SQL Join and Where Issue
So im having the following issue, when i run the following query
SELECT ClientSubId,ClientType,ClientStatus,AddressLine1,AddressLine2,
CityName,PostalCode,StateProvinceCode,
ClientFirstName,ClientLastName, BillManagerName
FROM CLIENT
JOIN
CLIENTADDRESS
ON CLIENT.ClientIdent = CLIENTADDRESS.ReferenceIdent
JOIN
CLIENTINDIVIDUAL
ON CLIENT.ClientIdent = CLIENTINDIVIDUAL.ClientIdent
JOIN
CLIENTPRACTICE
ON CLIENT.ClientIdent = CLIENTPRACTICE.ClientIdent
Im getting back all results that match all fields, witch is correct, However when i apply the where clause at the end
WHERE
CLIENT.ClientIdSubId = '48079'
I get back no results. Im confused as to why i dont get back any results when i apply the Where clause, but without it i get all the results and that ID number is apart of those results.
Results without the WHERE
Results With the Where
Are you sure the id is a String and not a number?
– Nathan Hughes
yesterday
Are you certain that
48079
is not in fact 48O79
?– Edward
yesterday
48079
48O79
Does the
CLIENT
exists in with that ClientIdSubId
? Did you try that simple query?– The Impaler
yesterday
CLIENT
ClientIdSubId
Have you tried turning it off and back on again?
– dfundako
yesterday
1 Answer
1
Your query is pretty simple. I can only see two possible issues:
There's no CLIENT
with ClienIdSubId
that is equal to '48079'
.
CLIENT
ClienIdSubId
'48079'
There is a CLIENT
with that criteria, but there's no matching row in CLIENTADDRESS
, in CLIENTINDIVIDUAL
, or CLIENTPRACTICE
. Make sure there are matching rows on each table since you are using INNER JOINS.
CLIENT
CLIENTADDRESS
CLIENTINDIVIDUAL
CLIENTPRACTICE
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Could you provide some sample data and expect result?
– D-Shih
yesterday