[dba-SQLServer] Newbie needs help with select statement

jean-paul jnatola at hotmail.com
Mon Feb 2 13:48:32 CST 2009


As it turns out,  the switchboard links everything
 
 
table contacts;
 
id prefix first_name last_name title organization mailing_address_1 mailing_address_2 mailing_address_3 mailing_city mailing_state mailing_zip_code mailing_country_id telephone mobile fax email password customer_number creation_date created_by modification_date unsubscribe_timestamp last_modified_by website_url region_id

table contacts_organization_types
 
id  organization_type  internal_only
 
table contacts_source_codes

id  source_code  internal_only
























Jean-Paul Natola








----------------------------------------
> Date: Mon, 2 Feb 2009 13:08:05 -0600
> To: dba-sqlserver at databaseadvisors.com
> From: robert at webedb.com
> Subject: Re: [dba-SQLServer] Newbie needs help with select statement
>
> Francisco,
>
> Actually, that is an INNER JOIN that he is attempting. The problem
> is that he is not using the correct columns. That is why he is not
> getting data back. And, if you try this type of join using the
> where clause instead, you will find that it is actually faster than
> using the correct join syntax. :-)
>
> Jean-Paul, you are going to have to tell us the names of the columns
> in your tables before we can help you.
>
>
> Robert
>
> At 03:58 PM 1/31/2009, you wrote:
>>Date: Sat, 31 Jan 2009 13:58:50 -0800
>>From: Francisco Tapia 
>>Subject: Re: [dba-SQLServer] Newbie needs help with select statement
>>To: Discussion concerning MS SQL Server
>> 
>>Message-ID:
>> 
>>Content-Type: text/plain; charset=windows-1252
>>
>>Because of Sql Server standards, try to stick to Joins made with the INNER /
>>LEFT / FULL / OUTER keywords (see books Online). Joins made at the where
>>clause do work but may have sporadic results that are not consistent.
>>
>>
>>-Francisco
>>http://sqlthis.blogspot.com | Tsql and More...
>>
>>
>>On Sat, Jan 31, 2009 at 1:56 PM, jean-paul wrote:
>>
>>>
>>> So I read about 50 webpages and decided to try this statement
>>>
>>> SELECT *FROM contacts, contacts_organization_typesWHERE contacts.id =
>>> contacts_organization_types.id
>
>
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
>
_________________________________________________________________
Windows Live™ Hotmail®:…more than just e-mail. 
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_hm_justgotbetter_explore_012009



More information about the dba-SQLServer mailing list