/docs/MyDocs

To get this branch, use:
bzr branch http://darksoft.org/webbzr/docs/MyDocs

« back to all changes in this revision

Viewing changes to DataBase/MySQL/sql/logic.htm

  • Committer: Suren A. Chilingaryan
  • Date: 2009-04-09 03:21:08 UTC
  • Revision ID: csa@dside.dyndns.org-20090409032108-w4edamdh4adrgdu3
import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<P>
 
2
<B>=,(<> </B> or <B> !=),<,>,<=,>= </B> also for strings <BR>
 
3
<B><=> </B> ( a<=>a - 1, a<=>NULL - 0, NULL<=>NULL - 1 ) <BR>
 
4
<B>|,&,<<,>>,~</B> bitwise opperations <BR>
 
5
<B>BIT_COUNT(n)</B> returns number of bits that ae set<BR>
 
6
<B>IS NULL, IS NOT NULL </B> <BR>
 
7
x<B> BETWEEN min AND max, IN (*,*,...), NOT IN (*,*,...) </B> <BR>
 
8
<B>AND,&&</B> ( 1 && NULL = 0 ) <BR>
 
9
<B>OR,||</B> ( 1 || NULL = 1 ) <BR>
 
10
<B>NOT,!</B> ( NOT NULL = NULL, NOT 2 = 0 ) <BR>
 
11
<B>ISNULL(expr)</B> ( for example ISNULL(1/0) - TRUE ) <BR>
 
12
<B>COALESCE(list)</B> return's not NULL elements of list ( list is *,*,... ) <BR>
 
13
<B>INTERVAL(N,N1,N2,...)</B> return's minimal i, such what Ni>N <BR>
 
14
</P><P>
 
15
<I>Later all expr's integer. Be carefull INT(0.1)=0!!! </I> <BR>
 
16
<B>IFNULL(expr1,expr2)</B> if (IS NULL expr1) expr2 else expr1 <BR>
 
17
<B>NULLIF(expr1,expr2)</B> if (expr1==expr2) NULL else expr1 <BR>
 
18
<B>IF(expr,expr1,expr2)</B> if (expr) expr1 else expr2 <BR>
 
19
<B>CASE value WHEN [compare-value] THEN result ELSE result END </B> <BR>
 
20
<B>CASE WHEN [condition] THEN result ELSE result END </B> <BR>
 
21
</P><P>
 
22
<B>ASCII(str)</B> return's ASCII code of first symbol, 0 if str="", NULL if str=NULL
 
23
</P><P>
 
24
<B>ORD(str)</B> if first symbol str is multibyte character then returns
 
25
((first byte ASCII)*256+(second byte ASCII))*256+(third byte ASCII), else works
 
26
as ASCII(str)
 
27
</P><P>
 
28
<B>CHAR(N1,N2,...)</B> returns string consisting of characters given by ASCII 
 
29
codes N1,N2,...
 
30
</P><P>
 
31
<B>CONV(N,from_base,to_base)</B> converts between different number bases. If <I>
 
32
to_base<0 </I> then N treated as signed, else as unsigned.<BR>
 
33
<B>BIN(N)</B> <=> <I>CONV(N,10,2)</I>, <B>OCT(N), HEX(N)</B><BR>
 
34
</P>