Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

String in Pivot geht nicht

Empfohlene Antworten

Hallo zusammen

Ich habe folgendes Problem. Ich habe eine SQL Table in der es drei Attribute gibt. Die Attribute enthalten ausschliesslich Buchstaben und keine Zahlen.

Ich habe hier unten mal die MSDN-Auszüge als Code reingestellt. Soweit sogut, würde auch alles funktionieren wenn << [164] AS Emp1 >> nur mit strings arbeiten würde!

Ich kann ich die [] ja keine Buchstabenzeichen eingeben. Das funktioniert ausschliesslich mit Zahlen. Wie kann ich jetzt jedem Buchstaben eine Zahl zuweise?

Info: In diesem Attribut hat es nur genau einen Buchstaben drin. Der lautet entweder A, B oder C!

Wie kann ich nun jedem Buchstaben einen Wertzuweisen, damit ich den damit suchen kann?

USE AdventureWorks;

GO

SELECT VendorID, [164] AS Emp1, [198] AS Emp2, [223] AS Emp3, [231] AS Emp4, [233] AS Emp5

FROM 

(SELECT PurchaseOrderID, EmployeeID, VendorID

FROM Purchasing.PurchaseOrderHeader) p

PIVOT

(

COUNT (PurchaseOrderID)

FOR EmployeeID IN

( [164], [198], [223], [231], [233] )

) AS pvt

ORDER BY pvt.VendorID;
Und so sieht die Tabelle zum Code oben aus:

VendorID    Emp1        Emp2        Emp3        Emp4        Emp5

1                4               3             5             4             4

2                4               1             5             5             5

3                4               3             5             4             4

4                4               2             5             5             4

5                5               1             5             5             5

Gruss

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.