Wednesday, 4 January 2012

MySql curdate

In MySQL the CURDATE() is used to return the current date in 'YYYY-MM-DD' format or 'YYYYMMDD' format depending on whether numeric or string is used in the function. CURRENT_DATE and CURRENT_DATE() are the synonym of CURDATE().
Note: The outputs depending upon the current date.

 

Syntax

CURDATE ()

 

Example

SELECT CURDATE();

 

Output

MySQL CURDATE()

See also

Mysql curdate function

MySQL date

MySQL DATE() takes the date part out from a datetime expression.

This is an important function of date and time function in Mysql.


Syntax

DATE(expr);

Where expr is a datetime.


 

Example

SELECT DATE('2008-05-17 11:31:31') as required_date;

 

Explanation

The statement describe above will filter the date portion from the mentioned datetime 2008-05-17 11:31:31.

 

Output

MySQL DATE()

Current Mission of NASA - Advanced Composition Explorer (ACE) Mission Overview

Mission Summary

The Advanced Composition Explorer (ACE) is an Explorer mission that was managed by the Office of Space Science Mission and Payload Development Division of the National Aeronautics and Space Administration (NASA). More on the ACE personnel, including scientific Co-Investigators can be found here.
ACE launched on a McDonnell-Douglas Delta II 7920 launch vehicle on August 25, 1997 from the Kennedy Space Center in Florida  .......




Science Goals

The prime objective of ACE is to measure and compare the composition of several samples of matter, including the solar corona, the solar wind, and other interplanetary particle populations, the local interstellar medium (ISM), and galactic matter. While there has been great progress addressing these objectives, the changing conditions over the solar cycle present new opportunities. ...

MySQL substring

MySQL SUBSTRING() returns a specified number of characters from a particular position of a given string.

Syntax

SUBSTRING(str, pos, len)
 

Example

SELECT SUBSTRING('w3resource',4,3);

Explanation

The above MySQL statement returns 3 numbers of characters from the 4th position of the string ‘w3resource’.

Output

MySQL SUBSTRING()
 

MySql count


MySQL aggregate functions retrieve a single value after performing a calculation on a set of values.
In general, aggregate functions ignore null values.
Often, aggregate functions are accompanied by the GROUP BY clause of the SELECT statement.


MySQL COUNT() function us used to count of number of non-NULL values of a given expression.

This function return 0 when  does not find any matching row from the table.

Syntax

COUNT(expr);
Where expr is an expression.
SELECT COUNT(*)
FROM author;

Explanation

The above MySQL statement will return the number of rows in author table.

Output

mysql aggregate functions and grouping count function

See also : 
 Mysql count() function




MySQL find_in_set function

In MySQL the FIND_IN_SET() returns the position of a string when it present  within a list of strings.

The string list itself is a string contains substrings separated by ‘,’ (comma) character.

The return value 0 when search string does not exist in the string list.

The return value is  NULL if either of the arguments is NULL.

Syntax :

FIND_IN_SET (search string, string list)


Example

SELECT FIND_IN_SET('ank','b,ank,of,monk'); 

Explanation 

 

The above statement finds the search string ‘ank’ at 2nd place within the string list. So it returns 2.

Output

 

MYSQL FIND_IN_SET 

 

 

 

 

See also :

Mysql find_in_set function