terça-feira, 6 de setembro de 2016

SEQUENCE IN SQL

That's the order of the select

1 - WHERE
2 - GROUP
3 - HAVING
4 - SELECT

Há!

domingo, 4 de setembro de 2016

WILD CARDS IN SQL SERVER

select productnumber, listprice from sales where productnumber like 'BR-_[0-9][0-9]_-[0-9][0-9]'


BR-_[0-9][0-9]_-[0-9][0-9]
Starts with BR
dash
any character
number, number
any character
dash
number, number

quarta-feira, 29 de junho de 2016

DELTA CODE CONVERSION


The DELTA code is as follows

DELTA code of 4 is

GAMA CODE -> 110,00 -- 110 occupies 3 bits. 3 in gamma code is 101, therefore 4 in delta code would be

101,00

DELTA code of 5 is

GAMA CODE -> 110,01 - 110 occupies 3 bits. 3 in gamma code is 101, therefore 5 in delta code would be



Explanation of gamma conversion is here
http://netdaniels.blogspot.com.br/2016/06/gamma-code-conversion.html

GAMMA CODE CONVERSION


Hi!
Following the explanation of the link above I figured out how to convert numbers to gamma code.
Ex:
Number 4
UNARY CODE -> 11110
BINARY CODE -> 100
OFFSET -> 00
LENGTH -> 110
GAMA CODE -> 110,00
OFFSET -> IT IS THE BINARY CODE WITHOUT THE FIRST BIT FROM LEFT TO RIGHT. 100 becomes 00.
LENGTH -> NUMBER OF BITS THAT THE OFFSET OCCUPIES, in this case, 00 occupies  2 bits
GAMA CODE IS LENGTH, OFFSET, Therefore 110,00