Re: Can some explain this to me?
- From: --CELKO-- <jcelko212@xxxxxxxxxxxxx>
- Date: Fri, 26 Oct 2007 17:36:51 -0700
. The mistake I made was that the column pers_companyid does not exist. It should have been comp_companyid. <<
Google for a recent posting of mine on scoping rules in SQL. Then
learn how to properly name data elements -- why is a personnel
company_id a totally different kind of attribute from a company
company_id? That is what different names imply! If you had obeyed
ISO-11179, your query would have run as intended.
DELETE FROM Personnel -- collective name
WHERE company_id -- scopes to Personnel
IN (SELECT company_id -- scopes to Companies
FROM Companies -- plural name
WHERE contract_expiry IS NOT NULL);
Do entire companies expire in your data model? or does some
relationship between them and your personnel expire?
Get a copy of SQL PROGRAMMING STYLE and it will help clear up your
thinking.
.
- References:
- Can some explain this to me?
- From: davidaustinarcher
- Can some explain this to me?
- Prev by Date: Re: ODBC Failed [Microsoft][ODBC SQL ...NamedPipes]ConnectionWrite (WrapperWrite()).
- Next by Date: Re: Slow Execution Performance
- Previous by thread: Re: Can some explain this to me?
- Next by thread: MCDBA - SQL Server 2005 Certification?
- Index(es):
Relevant Pages
|