SQL - assorting data

后端 未结 1 614
滥情空心
滥情空心 2021-01-26 14:34

So, my school teacher asked me to assort some data, from an existing database. This is easy enough to do manually, but too lenghty to do it if more than 100 records..

Th

相关标签:
1条回答
  • 2021-01-26 14:39

    How about:

    SELECT  
        CONTACTS.name,
        EMAILS.email
    FROM 
    CONT_EMAIL INNER JOIN CONTACTS 
    ON CONT_EMAIL.name_ID = CONTACTS.ID
    INNER JOIN EMAILS
    ON CONT_EMAIL.email_ID = EMAILS.ID
    ORDER BY CONTACTS.name;
    

    This should work with about any database system.

    0 讨论(0)
提交回复
热议问题