Archive for 1. August 2008
whhoooo who - SQL UPDATE A PORTION OF FIELD FROM FIELD IN OTHER FILE
1. August 2008 by admin.
UPDATE prddtalib/crtran Set CROBATCH = (SELECT
substr(client_ID,4,2) FROM ritadb30/request where crtran.crritaid =
request.troutd) concat substr(crobatch,3,10)
WHERE crtran.crritaid IN (Select troutd FROM
ritadb30/request)
50 rows updated in CRTRAN in PRDDTALIB.
11:55 pm still got it
Posted in SQL | No Comments »
SQL STUFF I FORGET
1. August 2008 by admin.
String Functions
| Function | Description | CHAR(N) | Returns the the string representation of the number N. |
|---|---|
| CHAR_LENGTH(S) | Returns the length of a string. |
| CONCAT(S1, S2) | Concatenates S1 with S2. |
| SUBSTR(S, I, L) | Returns a substring of S, starting at index I of lenght L. |
| LOWER(S) | Returns the lowercase representation of S. |
| UPPER(S) | Returns the uppercase representation of S. |
| TRIM(S) | Removes spaces from the beggining and and of S. |
| RTRIM(S) LTRIM(S) |
Removes spaces at the begging (right) or end (left) of S. |
Date and Time Functions
| Function | Description | CURDATE() CURTIME() |
Returns the system’s current date/time. |
|---|---|
| DATE(D) DATE(T) |
Converts a string representation of a date/time into into a date/time value. |
| DAY(D) | Returns the day(1-31) from the date D. |
| WEEK(D) | Returns the week (1-54) from the date D. |
| MONTH(D) | Returns the month (1-12) from the date D. |
| YEAR(D) | Returns the year from the date D. |
| DAYOFWEEK(D) | Returns the week day (1-7) from the date D where 1 is Sunday. |
| DAYOFWEEK_ISO(D) | Returns the week day (1-7) from the date D where 1 is Monday. |
| DAYOFYEAR(D) | Returns the number of the day, in a year (1-366). |
| HOUR(T) | Returns the hour (0-24) from the time T. |
| MINUTE(T) | Returns the minute from the time T. |
| SECOND(T) | Returns the second from the time T. |
| MICROSECOND(T) | Returns the microsecond from the time |
Posted in SQL | No Comments »
|