Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Simple SQL Query Question

Re: Simple SQL Query Question

From: novicedba <novicedba_at_hotmail.com>
Date: Mon, 02 Jul 2001 01:38:48 -0700
Message-ID: <F001.0033ED1F.20010702005643@fatcity.com>

you could achieve this using decode
 
 
cozI am anoviceOracle Certifiable DBBS
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

  Sent: Monday, July 02, 2001 1:00 PM
  Subject: Simple SQL Query Question   

  I've a table with
  the following structure and sample data :
<SPAN

  class=270522206-02072001> 
<SPAN

  class=270522206-02072001>Station          Emission_Freq       
  Reception_Freq
<SPAN

  class=270522206-02072001>--------        
  -----------------        
  ------------------

<SPAN

  class=270522206-02072001>STAT1       
  192.5                        

  193.5
<SPAN

  class=270522206-02072001>STAT2          193   
<SPAN

  class=270522206-02072001>STAT2          194
<SPAN

  class=270522206-02072001>STAT2       
  193.5                        

  194.5
<SPAN

  class=270522206-02072001>STAT2          195
<SPAN

  class=270522206-02072001> 
<SPAN

  class=270522206-02072001> 
  And I would like
  to select the number of frequencies, sort of count(*), for a given station and   multiply that value by 2 if the station has Emission frequency and reception   frequency and multiply by one if the station has only the emission frequency   or only the reception frequency.  I don't know how to use a condition in   SQL.  I'm sure that it's possible to do it but I don't know how.    Can anybody help me ?
<FONT face=Arial color=#ff0000
  size=2>------------------------------------------------------------------------------------
  @biy @lemu
<A

  href="mailto:abiy.alemu_at_criltelecom.com">abiy.alemu_at_criltelecom.com
<SPAN

  class=630595213-05042001>Database Administration   Engineer
<IMG height=17

  alt="Groupe CRIL TECHNOLOGY" hspace=0   src="http://www.criltechnology.com/images/cril.gif" width=177   align=top>
  France
    Received on Mon Jul 02 2001 - 03:38:48 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US