Câu 51: 70-461: MCSA Querying Microsoft SQL Server 2012/2014
SIMULATION -You have a database named Sales that contains the tables as shown in the exhibit. (Click the Exhibit button.) You need to create a query for a report. The query must meet the following requirements: ✑ Return the last name of the customer who placed the order. ✑ Return the most recent order date for each cu…
Nội dung câu hỏi
SIMULATION -You have a database named Sales that contains the tables as shown in the exhibit. (Click the Exhibit button.) You need to create a query for a report. The query must meet the following requirements: ✑ Return the last name of the customer who placed the order. ✑ Return the most recent order date for each customer. ✑ Group the results by CustomerI D. ✑ Order the results by the most recent OrderDate. ✑ Use the database name and table name for any table reference. ✑ Use the first initial of the table as an alias when referencing columns in atable. The solution must support the ANSI SQL-99 standard and must NOT use object identifiers. Part of the correct T-SQL statement has been provided in the answer area. Complete the SQL statement.
Các lựa chọn
Đáp án được giữ gọn theo nhãn A, B, C, D trong phần bình chọn tương tác.
- A. Please review the explanation part for this answer. SELECT o.LastName,MAX (o.OrderData) AS MostRecentOrderDataFROM Sales.Orders AS o -GROUP BY o.CustomerID -ORDER BY o.OrderDate DESC — đáp án hiện tại
Cộng đồng
0 bình luận công khai. Tên thành viên được ẩn một phần.