Results 1 to 6 of 6

Thread: SQL

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User entium's Avatar
    Join Date: May:2003
    Location:
    Posts: 1,426

    Question SQL

    .
    If (m > 40) And (m < 80) Then
    y = y + 1800
    m = m - 40
    Else
    y = y + 1900
    Last 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

  2. #2
    Registered User nettle's Avatar
    Join Date: Sep:2003
    Location: Sofia
    Posts: 402
    stored , , sql .

  3. #3
    End User/Developer dNA's Avatar
    Join Date: Apr:2005
    Location:
    Posts: 564
    ? SELECT .. ?
    SQL ? () , , : , ..
    ", -"
    - -...

  4. #4
    Undead user Oldman's Avatar
    Join Date: Oct:2003
    Location: outside
    Posts: 432
    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
    )
    Oracle 9i , . .

    EDIT:
    Entium, Access .
    Last edited by Oldman; 2nd February 2006 at 15:01.
    .

  5. #5
    Registered User entium's Avatar
    Join Date: May:2003
    Location:
    Posts: 1,426

    Question

    :
    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

  6. #6
    Automatic Jack
    Join Date: Feb:2004
    Location:
    Posts: 216
    , , ? , , Oldman, ?... , -, , 1, 2, 3 4 <20, 20-30, 30-65, >65. . - "6", ,
    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))
    , , , - view, . .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |