Great website
Watch online Movies
Listen songs
Live Tv Channels
Telugu,Hindi,Tamil,Kannada,Panjabi,Bengali,Marathi
Great website
Watch online Movies
Listen songs
Live Tv Channels
Telugu,Hindi,Tamil,Kannada,Panjabi,Bengali,Marathi
--group by day
SELECT COUNT(* ),
Dateadd(DAY,Datediff(DAY,0,HireDate),0) 'day'
FROM Employees
GROUP BY Dateadd(DAY,Datediff(DAY,0,HireDate),0)
ORDER BY Dateadd(DAY,Datediff(DAY,0,HireDate),0) DESC
--group by Month
SELECT COUNT(* ),
Dateadd(MONTH,Datediff(MONTH,0,HireDate),0) 'Month'
FROM Employees
GROUP BY Dateadd(MONTH,Datediff(MONTH,0,HireDate),0)
ORDER BY Dateadd(MONTH,Datediff(MONTH,0,HireDate),0) DESC
Quantifiers provide a simple way to specify within a pattern how many times a particular character or set of characters is allowed to repeat itself. There are three non-explicit quantifiers:
Quantifiers always refer to the pattern immediately preceding (to the left of) the quantifier, which is normally a single character unless parentheses are used to create a pattern group. Below are some sample patterns and inputs they would match.
Pattern | Inputs (Matches) |
| ||
| fo* | foo, foe, food, fooot, "forget it", funny, puffy | ||
| fo+ | foo, foe, food, foot, "forget it" | ||
| fo? | foo, foe, food, foot, "forget it", funny, puffy | ||
In addition to specifying that a given pattern may occur exactly 0 or 1 time, the ? character also forces a pattern or subpattern to match the minimal number of characters when it might match several in an input string.
Explicit quantifiers are positioned following the pattern they apply to, just like regular quantifiers. Explicit quantifiers use curly braces {} and number values for upper and lower occurrence limits within the braces. For example, x{5} would match exactly five x characters (xxxxx). When only one number is specified, it is used as the upper bound unless it is followed by a comma, such as x{5,}, which would match any number of x characters greater than 4. Below are some sample patterns and inputs they would match.
Pattern | Inputs (Matches) |
ab{2}c | abbc, aaabbccc |
ab{,2}c | ac, abc, abbc, aabbcc |
ab{2,3}c | abbc, abbbc, aabbcc, aabbbcc |
The constructs within regular expressions that have special meaning are referred to as metacharacters. You've already learned about several metacharacters, such as the *, ?, +, and { } characters. Several other characters have special meaning within the language of regular expressions. These include the following: $ ^ . [ ( | ) ] and \.
. It matches any single character
^ used to designate the beginning of a string (or line)
$ is used to designate the end of a string
\ is used to "escape" characters from their special meaning
| (pipe) is used for alternation, essentially to specify 'this OR that' within a pattern.
( ) used to group patterns.
Some examples of metacharacter usage are listed below.
Pattern | Inputs (Matches) |
. | a, b, c, 1, 2, 3 |
.* | Abc, 123, any string, even no characters would match |
^c:\\ | c:\windows, c:\\\\\, c:\foo.txt, c:\ followed by anything else |
abc$ | abc, 123abc, any string ending with abc |
(abc){2,3} | abcabc, abcabcabc |
In order to include a literal version of a metacharacter in a regular expression, it must be "escaped" with a backslash.
For instance if you wanted to match strings that begin with "c:\" you might use this: ^c:\\
So something like a|b would match anything with an 'a' or a 'b' in it, and would be very similar to the character class [ab].
Character classes are a mini-language within regular expressions, defined by the enclosing hard braces [ ]. The simplest character class is simply a list of characters within these braces, such as [aeiou].
To specify any numeric digit, the character class [0123456789] could be used. However, since this would quickly get cumbersome, ranges of characters can be defined within the braces by using the hyphen character, -.
Eg: [a-z],[A-Z],[0-9]
If you need a hyphen to be included in your range, specify it as the first character. For example, [-.? ]
You can also match any character except a member of a character class by negating the class using the carat ^ as the first character in the character class. Thus, to match any non-vowel character, you could use a character class of [^aAeEiIoOuU].
Pattern | Inputs (Matches) |
^b[aeiou]t$ | Bat, bet, bit, bot, but |
^[0-9]{5}$ | 11111, 12345, 99999 |
^c:\\ | c:\windows, c:\\\\\, c:\foo.txt, c:\ followed by anything else |
abc$ | abc, 123abc, any string ending with abc |
(abc){2,3} | abcabc, abcabcabc |
^[^-][0-9]$ | 0, 1, 2, … (will not match -0, -1, -2, etc.) |
Metacharacter | Equivalent Character Class |
\a | Matches a bell (alarm); \u0007 |
\b | Matches a word boundary except in a character class, where it matches a backspace character, \u0008 |
\t | Matches a tab; \u0009 |
\r | Matches a carriage return; \u000D |
\w | Matches a vertical tab; \u000B |
\f | Matches a form feed; \u000C |
\n | Matches a new line; \u000A |
\e | Matches an escape; \u001B |
\040 | Matches an ASCII character with a three-digit octal. \040 represents a space (Decimal 32). |
\x20 | Matches an ASCII character using 2-digit hexadecimal. In this case, \x2- represents a space. |
\cC | Matches an ASCII control character, in this case ctrl-C. |
\u0020 | Matches a Unicode character using exactly four hexadecimal digits. In this case \u0020 is a space. |
\* | Any character that does not represent a predefined character class is simply treated as that character. Thus \* is the same as \x2A (a literal *, not the * metacharacter). |
\p{name} | Matches any character in the named character class 'name'. Supported names are Unicode groups and block ranges. For example Ll, Nd, Z, IsGreek, IsBoxDrawing, and Sc (currency). |
\P{name} | Matches text not included in the named character class 'name'. |
\w | Matches any word character. For non-Unicode and ECMAScript implementations, this is the same as [a-zA-Z_0-9]. In Unicode categories, this is the same as [\p{Ll}\p{Lu}\p{Lt}\p{Lo}\p{Nd}\p{Pc}]. |
\W | The negation of \w, this equals the ECMAScript compliant set [^a-zA-Z_0-9] or the Unicode character categories [^\p{Ll}\p{Lu}\p{Lt}\p{Lo}\p{Nd}\p{Pc}]. |
\s | Matches any white-space character. Equivalent to the Unicode character classes [\f\n\r\t\v\x85\p{Z}]. If ECMAScript-compliant behavior is specified with the ECMAScript option, \s is equivalent to [ \f\n\r\t\v] (note leading space). |
\S | Matches any non-white-space character. Equivalent to the Unicode character categories [^\f\n\r\t\v\x85\p{Z}]. If ECMAScript-compliant behavior is specified with the ECMAScript option, \S is equivalent to [^ \f\n\r\t\v] (note space after ^). |
\d | Matches any decimal digit. Equivalent to [\p{Nd}] for Unicode and [0-9] for non-Unicode, ECMAScript behavior. |
\D | Matches any non-decimal digit. Equivalent to [\P{Nd}] for Unicode and [^0-9] for non-Unicode, ECMAScript behavior. |
Most people learn best by example, so here are a very few sample expressions.
Pattern | Description |
^\d{5}$ | 5 numeric digits, such as a US ZIP code. |
^(\d{5})|(\d{5}-\d{4}$ | 5 numeric digits, or 5 digits-dash-4 digits. This matches a US ZIP or US ZIP+4 format. |
^(\d{5})(-\d{4})?$ | Same as previous, but more efficient. Uses ? to make the -4 digits portion of the pattern optional, rather than requiring two separate patterns to be compared individually (via alternation). |
^[+-]?\d+(\.\d+)?$ | Matches any real number with optional sign. |
^[+-]?\d*\.?\d*$ | Same as above, but also matches empty string. |
^(20|21|22|23|[01]\d)[0-5]\d$ | Matches any 24-hour time value. |
/\*.*\*/ | Matches the contents of a C-style comment /* … */ |
Regex test;
test = new Regex("testing");
Match m = test.Match("here is a string for testing");
if (m.Success) {
// do whatever you want
}
Hi All!
This is good list of email etiquettes. Please go through it and make sure to use it in your day to day work.
Why are you writing to me?
State the purpose of your e-mail -- it is a good practice to have a subject line that explains what follows and how high on the priority list it should be. This information has to be in two places:
i. The subject box, which is part of the compose e-mail form. Here, state the reason for your mail. If you are writing it to apply for leave, you could say 'Leave application'.
ii. Subject line in the main e-mail body; just as you would in any formal business letter. Here, you could say: Sub: Leave application, April 1-April 15 2006
Greet me right
Address people you don't know as Mr, Mrs, Ms or Dr. Address someone by first name only if you are on a first name basis with each other; it is okay, under these circumstances, to use first names on a formal business missive.
If you do not know the name of the person, or whether it is a man or a woman, it is best to address the person concerned as: Dear Sir / Madam, Whomsoever it may concern, The Manager; etc.
And your point is?Get to the point.
Verbosity and extreme terseness are two ends of a spectrum, you should try for the middle -- state your point without sounding rudely brief or chatty.
Remember to state your point and what you expect from the reader of your mail in clear terms. There should also be a clear structure -- an introduction, body and conclusion.
While are all right for personal e-mail, they show a level of informality not encouraged in formal business communication. Frequently used abbreviations you may use include FYI (for your information), Pvt., Ltd., Co., etc., OK.
The magic of spellsThough using a spell check is a must, don't rely on it completely. The most common areas of errors and confusion are -- two, too and to.
For eg: Wrong: I would like two order too other books two.
Correct: I would like to order two other books, too.
A hit or miss effort with spellings does not help -- use a dictionary.
Write rightGood grammar is very important. A correctly framed sentence, with proper punctuation in place, is what you should aim at. Be very careful with commas, especially, as they change the meaning of a sentence.
A good example would be:
Wrong: All foreign tea, tree, oils are free from duty.
Correct: All foreign tea tree oils are free from duty.
Use action words and 'I' statements -- they evoke a sense of reassurance in the reader. For eg:
On receipt of your earlier mail, I/ we have already set things in motion and I/ we assure you that you will receive your order on time.
I was responsible for the day-to-day working and administration of the office; planning, scheduling, and achieving targets were my areas of contribution.
Mind your P's and Q's Though a friendly tone is encouraged, basic corporate etiquette rules do apply. So, maintain a well-mannered, friendly polite stance.
Gender-neutral language is politically correct -- couch your e-mail accordingly. This essentially means you should not assume a person's gender on the basis of the designation. Keep the e-mail neutral.Attachment breeds detachmentWith worms, viruses, and spam, nobody wants to open attachments anymore, not even if the e-mail is from one's own mother. If you do need to send an attachment, confirm this with the recipient first.
Like an arrow shot from a bowAn e-mail is like the spoken word -- once sent, you can't recall it. By the time you press the recall button, chances are it has already reached and, with it, your recall message. This compounds the embarrassment. So, think before you dash off something.
The KISS rulesKeep It Short and Simple. Use simple sentences, words that don't need a dictionary. Use universal formats -- not all systems support HTML rich style, or tables and tabs. You could lose much by way of appearances if your recipient's system can't support all that fancy formatting you spent hours working on.
Smile pleaseSmileys and other emoticons are a way to add 'body language' to e-mail. When used appropriately and sparingly, smileys do bring a touch of personalisation to otherwise impersonal mail. Of course, due care with regards to the appropriateness of the communication must be taken.
You would not use emoticons in job application covering letters, while delivering bad news (delay in order, loss of job, etc). Use discretion.
Emoticons are generally used to add comfort to the communication or soften the blow. The most common smiley faces are probably these:
:-) OR :) Just a smile / can be used for greeting or making a point gently. :-( OR :( To show mild displeasure or that something is not going the way you want it to. ;-) Equivalent to a wink -- used to convey that a particular comment is a joke and not to be taken too seriously. ;-> To be used sparingly, and with people you know well, as this signifies a provocative comment.
Humour doesn't travelWhat seems funny to you may be offensive to someone else. Remember, humour doesn't travel well. Jokes about religion, sports, political figures, and women may come across as tasteless and should be avoided at all costs.
Swift and promptBe prompt in replying. That is why we have the Internet. If a prompt response were not expected, one would use the postal service.
CAPITAL, MY DEAR FELLOWIF YOU WRITE IN CAPITALS, IT SEEMS AS IF YOU ARE SHOUTING. You could get really angry responses to your e-mail if you do so, and trigger a flame war.
Fw. Fw. Fw. Do not forward chain letters -- simply delete them. Also avoid forwarding them to professional contacts.
Shh... It's a secretIf it is a secret, don't send it via e-mail -- you never know where it will end up.
ConnectionsKeep the thread of the message as part of your mail; this will help keep the context handy. The thread is the previous message/s in context to which this e-mail is being written. Last but not least, please, please read the e-mail before you click the 'Send' button. It will save you a lot of embarrassment and misunderstanding.
One of the uses of Common type expression
WITH Hierarchy(EmployeeId,Employeename,Parentid,Hlevel)
AS (SELECT EmployeeId,
Employeename,
Parentid,
0 AS Hlevel
FROM OrgEntitiesMaster
WHERE Parentid = 0
UNION ALL
SELECT H.EmployeeId,
H.Employeename,
H.Parentid,
Hlevel + 1
FROM OrgEntitiesMaster H
INNER JOIN HIERARCHY P
ON H.Parentid = P.EmployeeId
)
SELECT *
FROM HIERARCHY
Popular Posts
|