[dba-SQLServer] Newbie needs help with select statement

jean-paul jnatola at hotmail.com
Fri Jan 30 22:58:45 CST 2009


Hi all,

So I was attempting to for the first time to get data using the select statment

here was my first syntax
SELECT * FROM `contacts` WHERE 1

it returned all the records (as I wanted) 9050 records
contact name  address emaill etcc..
now there is another table called contacts_organization_types 
I wanted the  corresponding output to come out in the same query

so i tried this
SELECT * FROM `contacts`,`contacts_organization_types` WHERE 1

now i got the same results as above-  but instead of it  adding the field to the list it returned each record from the contacts with every single cust_org_types for example



    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    

    

    

    

    

    

    

    

first statement results;

id first name last name      email
1  jp            natola 
 

second statment results;



id first name last name      email   organaization type
1  jp            natola                    NGO


1  jp            natola                    MED

1  jp            natola                    Donor

1  jp            natola                    Education

1  jp            natola                    Media

How do i modify the statement to just give me the record with the actual value that is in the contacts record

thanks

 

 





_________________________________________________________________
Hotmail® goes where you go. On a PC, on the Web, on your phone. 
http://www.windowslive-hotmail.com/learnmore/versatility.aspx#mobile?ocid=TXT_TAGHM_WL_HM_versatility_121208 


More information about the dba-SQLServer mailing list