The question with criteria
(有标准的问题)
Any help with creating the SELECT statement that satisfies this criteria would be appreciated.
(创建满足此条件的SELECT语句的任何帮助将不胜感激。)
The tables I believe are being use are as follows. (我认为正在使用的表格如下。)
CREATE TABLE client
( ClientID
varchar(7) NOT NULL, ClientName
varchar(45) DEFAULT NULL, Street
varchar(100) DEFAULT NULL, City
varchar(45) DEFAULT NULL, State
char(2) DEFAULT NULL, Zip
char(5) DEFAULT NULL, PRIMARY KEY ( ClientID
) )
(创建表client
( ClientID
varchar(7)NOT NULL, ClientName
varchar(45)DEFAULT NULL, Street
varchar(100)DEFAULT NULL, City
varchar(45)DEFAULT NULL, State
char(2)DEFAULT NULL, Zip
char(5)DEFAULT NULL,PRIMARY KEY( ClientID
)))
CREATE TABLE contact
( ClientID
varchar(7) NOT NULL, ContactName
varchar(45) NOT NULL, ContactPhone
char(17) DEFAULT NULL, ContactEmail
varchar(45) DEFAULT NULL, PRIMARY KEY ( ClientID
, ContactName
), CONSTRAINT FK_ClientContact
FOREIGN KEY ( ClientID
) REFERENCES client
( ClientID
) )
(CREATE TABLE contact
( ClientID
varchar(7)NOT NULL, ContactName
varchar(45)NOT NULL, ContactPhone
char(17)DEFAULT NULL, ContactEmail
varchar(45)DEFAULT NULL,PRIMARY KEY( ClientID
, ContactName
),CONSTRAINT FK_ClientContact
FOREIGN KEY( ClientID
)参考client
( ClientID
)))
Here is what I've got so far.
(这是我到目前为止所得到的。)
SELECT ClientName, contact.ContactName, ContactPhone, ContactEmail, count() FROM client, contact GROUP BY ClientName, ContactName, ContactPhone, ContactEmail ORDER BY ClientName; (选择ClientName,contact.ContactName,ContactPhone,ContactEmail,count()从客户端,GROUP BY ClientName,ContactName,ContactPhone,ContactEmail OR BY BY ClientName;)
ask by Bellaboof translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…