Telechargé par youcef hedibel

Tutorial SQLServer 04

publicité
SQL
SQL
SQL
PRINT
PRINT
PRINT WhatToPrint
PRINT
PRINT
SELECT
SELECT
SELECT What
SELECT
PRINT
PRINT 
PRINT
Messages
SQL
SELECT
SELECT 
Results
PRINT
SELECT
SELECT 'Hourly Salary', 24.85;
PRINT
SELECT
SELECT
SELECT 226.75;
SELECT
SELECT
SELECT (SELECT 448.25);
GO
SELECT (SELECT (SELECT 1350.75));
GO
AS
SELECT
SELECT
PRINT
SELECT
SELECT
Caption
Column
(No column name)
AS
AS
SELECT 24.85 AS HourlySalary;
''
AS
SELECT 24.85 AS 'HourlySalary';
AS
[]
SELECT 24.85 AS 'Hourly Salary';
SELECT 24.85 AS [Hourly Salary];
AS
SELECT 'James Knight' As FullName, 20.48 AS Salary;
SELECT 'James Knight' As [Full Name], 20.48 AS [Hourly Salary];
Unary operator
Unsigned
PRINT +1250
SELECT -1250
Binary Operators
SQL
PRINT 'Henry ' + 'Kono'
SQL
PRINT (154 - 12) + 8
PRINT 154 - (12 + 8)
134
150
SELECT 7 / 4
2
SELECT 7 / 4.0
1.750000
,
%
SQL
Modulo
PRINT 128 % 42
2
SELECT
(SELECT 448.25 * 3) +
(SELECT 82.28 - 36.04);
GO
Bits
7
Bits
Bits
Bits
NOT
0
NOT
NOT
~Value
PRINT ~158
Bit
Transact-SQL
1
Value 1
~Value 0
1
0
1
0
0
1
0
0
1
0
1
0
1
0
1
bit
0
1
1
B
248
248
byte
xF8 0
11111000
bit
Value 1
~Value 0
1
0
1
0
1
0
1
0
0
1
0
1
NOT
0
1
AND
Operand1 & Operand2
bit
bit
0
Bit1
0
1
0
1
Bit2
0
0
1
1
1
1
Bit1 & Bit2
0
0
0
1
10111011
242
11110010
242
187
xBB0
xF2 0
AND
N1
N2
N1 & N2
PRINT 187 & 242
1
1
1
0
1
0
1
1
1
Binary
1 1
1 0
1 0
0
0
0
1
1
1
1
0
0
Decimal
187
242
178
178
OR
bit
Value1 | Value2
0
bit
1
Bit1
0
1
0
1
Bit2
0
0
1
1
1
1
1
0
1
1
1
1
1
bit
Bit1 | Bit2
0
1
1
1
242
OR
N1
N2
N1 | N2
0
Binary
1 1
1 0
1 1
0
0
0
187
1
1
1
1
0
1
Decimal
187
242
251
PRINT 187 | 242
251
XOR
XOR
Value1 ^ Value2
bit
1
Bit1
0
1
Bit2
0
0
Bit1 ^ Bit2
0
1
0
1
0
0
1
1
1
242
XOR
N1
N2
N1 ^ N2
1
1
0
0
1
1
1
1
0
1
0
187
Binary
1 1
1 0
0 1
0
0
0
1
1
0
1
0
1
Decimal
187
242
73
PRINT 187 ^ 242;
73

UtilityCompany1
0.0900

224
kWh
148

8.50
kWh 0.0650
Téléchargement