jackson_cn
Members-
Content Count
9 -
Joined
-
Last visited
Everything posted by jackson_cn
-
A Good Resource For Compilers Both free/open-source and commercial.
jackson_cn replied to Eric Straven's topic in Programming
the DEv c++ is better compliler! I like it! -
The concept of the NULL value is a common source of confusion for newcomers to SQL, who often think that NULL is the same thing as an empty string "". This is not the case! For example, the following statements are completely different: mysql> INSERT INTO my_table (phone) VALUES (NULL);mysql> INSERT INTO my_table (phone) VALUES ("");Both statements insert a value into the phone column, but the first inserts a NULL value and the second inserts an empty string. The meaning of the first can be regarded as ``phone number is not known'' and the meaning of the second can be regarded as ``she has no phone''. In SQL, the NULL value is always false in comparison to any other value, even NULL. An expression that contains NULL always produces a NULL value unless otherwise indicated in the documentation for the operators and functions involved in the expression. All columns in the following example return NULL: mysql> SELECT NULL,1+NULL,CONCAT('Invisible',NULL);If you want to search for column values that are NULL, you cannot use the =NULL test. The following statement returns no rows, because expr = NULL is FALSE, for any expression: mysql> SELECT * FROM my_table WHERE phone = NULL;To look for NULL values, you must use the IS NULL test. The following shows how to find the NULL phone number and the empty phone number: mysql> SELECT * FROM my_table WHERE phone IS NULL;mysql> SELECT * FROM my_table WHERE phone = "";Note that you can only add an index on a column that can have NULL values if you are using MySQL Version 3.23.2 or newer and are using the MyISAM or InnoDB table type. In earlier versions and with other table types, you must declare such columns NOT NULL. This also means you cannot then insert NULL into an indexed column. When reading data with LOAD DATA INFILE, empty columns are updated with ''. If you want a NULL value in a column, you should use \N in the text file. The literal word 'NULL' may also be used under some circumstances. See section 6.4.9 LOAD DATA INFILE Syntax. When using ORDER BY, NULL values are presented first. In versions prior to 4.0.2, if you sort in descending order using DESC, NULL values are presented last. When using GROUP BY, all NULL values are regarded as equal. To help with NULL handling, you can use the IS NULL and IS NOT NULL operators and the IFNULL() function. For some column types, NULL values are handled specially. If you insert NULL into the first TIMESTAMP column of a table, the current date and time is inserted. If you insert NULL into an AUTO_INCREMENT column, the next number in the sequence is inserted.
-
ohi use fairy besti want to play with you somedays.shoud we?
-
i agree intel is better than AMD so in intel is usual used in the company most.
-
#include<iostream>#include<iomanip>using namespace std;int FirstDayofYear (int y);int DaysofMonth(int m);void printMonth(int m);void printHead(int m);bool LeapYear(int y);int WeekDay,year;main(){ cerr<<"please enter the year(>1):"; cin>>year; WeekDay=FirstDayofYear(year); cout<<"\n\n"<<year<<"Year\n"; cout<<"==……=="; for (int a=1;a<13;a++) printMonth(a); cout<<"\n"; system("pause"); getchar();}void printMonth(int m){ printHead(m); int day=DaysofMonth(m); for(int i=1;i<=day;i++) { cout<<setw(5)<<i; WeekDay=(WeekDay+day)%7; if(WeekDay==0) { cout<<endl; cout<<setw(5)<<" "; } }}void printHead(int m){ cout<<"\n\n"<<setw(2)<<m; cout<<"Month"<<setw(5)<<" Sunday"<<setw(5)<<"Monday"<<setw(5)<<"Tuesday"<<setw(5)<<"Wednesday"<<setw(5)<<"Thursday"\ <<setw(5)<<"Friday"<<setw(5)<<"Saturday\n"; cout<<setw(5)<<" "; for(int i=0;i<WeekDay;i++) cout<<setw(5)<<" ";}int DaysofMonth(int m){ switch(m) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: return 31; case 4: case 6: case 9: case 11: return 30; case 2: if(LeapYear(year)) return 29; else return 28; } return 0;}bool LeapYear(int y){ if((y%4==0) && (y%100 !=0) || (y%400==0)) return TRUE; else return FALSE;}int FirstDayofYear(int y){ long m; m=y*365; for(int i=1;i<y;i++) m+=LeapYear(i); return m%=7;}
-
i think p4 is good in stability.and reliable.