Posts Tagged ‘sql’

the Solution of MMC can not Open the SQL Server Enterprise Manager.MSC

the Solution of MMC can not open the SQL Server Enterprise Manager.MSC

MMC can not open the file C:\Program Files\Microsoft SQL Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC.

This may be because the file does not exist, is not an MMC console, or a later version of MMC to create. May also be because you do not have sufficient permissions to access this file.

Answer
To see on your hard drive the file, if it gets to another partition, see if you can open: Read more

Share Six Useful MySQL Statements

Today to introduce six  useful MySQL's SQL statements, many people may have to implement these functions with PHP.
1 calculate the number of years
You want to calculate the birthday person how old.
SELECT DATE_FORMAT (FROM_DAYS (TO_DAYS (now ()) - TO_DAYS (@ dateofbirth)), '% Y') + 0;
2 the difference between the two time
Made the difference between two datetime values​​. Assuming datetime dt1 and dt2 are the type of the format 'yyyy-mm-dd hh: mm: ss', then the number of seconds difference between them is:
UNIX_TIMESP (dt2) - UNIX_TIMESP (dt1)
Divided by 60 is the difference between the number of minutes divided by 3600 is the difference between the number of hours, then divided by 24 is the difference between the number of days.
3 shows a column appeared in the value of N times
SELECT id
FROM tbl
GROUP BY id
HAVING COUNT (*) = N;
4 calculation of working days between two dates Read more