MulaiMulai sekarang secara gratis

Calculating the absolute value

The Shipments table contains some bad data. There was a problem with the scales, and the weights show up as negative numbers. In this exercise, you will write a query to convert all negative weights to positive weights.

Latihan ini adalah bagian dari kursus

Intermediate SQL Server

Lihat Kursus

Petunjuk latihan

Write a query that converts all the negative values in the DeliveryWeight column to positive values.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

-- Return the absolute value of DeliveryWeight
SELECT DeliveryWeight,
       ___(___) AS AbsoluteValue
FROM Shipments
Edit dan Jalankan Kode