Results 1 to 6 of 6
Thread: SQL
Hybrid View
-
1st February 2006 16:31 #1
SQL
.
If (m > 40) And (m < 80) Then
y = y + 1800
m = m - 40
Else
y = y + 1900Last edited by entium; 1st February 2006 at 16:43.
EP43-DS3|E5200@3.33|ASUS EN9800GT HB /HTDI/ 512MB|2X2GB 800MHZ CL5 A-DATA|WD2500JB|NEC 4750A|BELINEA 1980S2
-
2nd February 2006 10:46 #2
-
2nd February 2006 12:05 #3
? SELECT .. ?
SQL ? () , , : , ..
", -"
- -...
-
2nd February 2006 13:11 #4Oracle 9i , . .Code:
Select EGN, (CASE WHEN (Month_temp>20)AND(Month_temp<33) THEN Month_temp - 20 WHEN (Month_temp>40)AND(Month_temp<53) THEN Month_temp - 40 ELSE Month_temp END) as The_Month, (CASE WHEN (Month_temp>20)AND(Month_temp<33) THEN Year_temp + 1800 WHEN (Month_temp>40)AND(Month_temp<53) THEN Year_temp + 2000 ELSE Year_temp + 1900 END) as The_Year From ( Select EGN, TO_NUMBER(SUBSTR(EGN,1,2)) as Year_temp, TO_NUMBER(SUBSTR(EGN,3,2)) as Month_temp From TABLE_WITH_EGN_COLUMN )
EDIT:
Entium, Access .Last edited by Oldman; 2nd February 2006 at 15:01.
.
-
2nd February 2006 13:28 #5
:
SELECT table.EGN, IIf((Val(Mid([EGN],3,2))>40),Val(Mid([EGN],5,2)) & "." & (Val(Mid([EGN],3,2))-40) & "." & 2000+Val(Mid([EGN],1,2)),IIf((Val(Mid([EGN],3,2))<13),Val(Mid([EGN],5,2)) & "." & (Val(Mid([EGN],3,2))) & "." & 1900+Val(Mid([EGN],1,2)),Val(Mid([EGN],5,2)) & "." & (Val(Mid([EGN],3,2))-20) & "." & Val(Mid([EGN],1,2)))) AS Expr1
FROM table;
10-20,20-30,30-65,>65 . oracle 8.1.7 10g.EP43-DS3|E5200@3.33|ASUS EN9800GT HB /HTDI/ 512MB|2X2GB 800MHZ CL5 A-DATA|WD2500JB|NEC 4750A|BELINEA 1980S2
-
7th February 2006 17:04 #6Automatic Jack
Join Date: Feb:2004
Location:
Posts: 216
, , ? , , Oldman, ?... , -, , 1, 2, 3 4 <20, 20-30, 30-65, >65. . - "6", ,
, , , - view, . .Code:select EGN, Age, decode(sign(Age - 20), -1, 1, decode(sign(Age - 30), -1, 2, decode(sign(Age - 65), -1, 3, 4))) from (select EGN, 6 - to_number(substr(EGN, 1, 2)) + 100 * decode(sign(Mth - 13), -1, 1, decode(sign(Mth-33), -1, 2, 0)) as Age from (select ENG as EGN, to_Number(substr(ENG, 3, 2)) as Mth from TheTable))




Reply With Quote
Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in