Jump to content
Sign in to follow this  
Hov044

Eine SQL Frage

Recommended Posts

Hallo Leute,

 

könnte einer von euch mir bei der Frage helfen, bin mir bei der antwort nicht sicher!

Ich tendiere auf B (es über die Spalte zu suchen),

was meint ihr so?

 

You are a database developer for Company.com You are designing a query that calculates the

number of orders that were made on October 27, 2005.

 

The Orders table is designed as shown in the following display.

 

OderID (PK) OrderDate …

int datetime …

 

An index is defined on the OrderDate column. You need to design the query to provide the fastest

performance.

Which Transact-SQL query should you use?

 

A. SELECT COUNT(*) FROM OrdersWHERE OrderDate BETWEEN '2005-10-26T00:00:00'

AND '2005-10-28T00:00:00'

B. SELECT COUNT(*) FROM OrdersWHERE CONVERT(CHAR(8), OrderDate, 112) =

'20051027'

C. SELECT COUNT(*) FROM OrdersWHERE YEAR(OrderDate) = 2005 AND

MONTH(OrderDate) = 10

AND DAY(OrderDate) = 27

D. SELECT COUNT(*) FROM OrdersWHERE DATEDIFF(day, OrderDate, '20051027') = 0

SELECT COUNT(*) FROM OrdersWHERE OrderDate >= '20051027' AND OrderDate <

'20051028'

 

 

Vielen Danke!!!!

Share this post


Link to post
Der letzte Beitrag zu diesem Thema ist mehr als 180 Tage alt. Bitte überlege Dir, ob es nicht sinnvoller ist ein neues Thema zu erstellen.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...