Please help  oracle sql counts question

Hi,
I am trying to get some counts on a client list where l count those clients who are getting the program
2353335 ONLY (which may be none of the cases in the example below but this is an obviously smaller subset of these data).
How can I count all the client ids where program = 2353335 but not where program = 2340845 or program =2353340?
Thanks in advance
Client_id     Program
260     2340845
260     2353340
510     2353340
510     2353335
510     2340845
520     2340845
520     2353340
525     2340845
525     2353335
765     2353340
1260     2340845
1260     2353335
1595     2353340
1595     2340845
1615     2340845
1835     2353340
1840     2353340
1840     2353335
1840     2340845
1845     2353335
1845     2340845

Hi,
if you want to select clients that only have program 2353335 and no other, the query below would help:
select client_id
from mytab m
where program = 2353335
and not exists (select 1 from mytab where client_id = m.client_id and program != 2353335);Just replace select client_id with select count(*) if you want just to count rows.
Best regards,
Nikolay
Edited by: Nikolay Savvinov on Jan 26, 2012 11:24 PM

Similar Messages

  • Please help me with this questions "if I purchased items through mac or windows is it possible to re-download those purchases on Apple TV though iCloud"

    Please help me with this questions "if I purchased items through mac or windows is it possible to re-download those purchases on Apple TV though iCloud"

    It depends on what country you're in and whether or not they're still available in the iTunes Store. Some purchased movies and all rentals won't be available.
    (108225)

  • Please help  me with some questions with batch input session?

    hello everyone.
      I come to some questions  like
    1 What is a batch input session ,
    2  What is the alternative to batch input session?
    3  An ABAP program creates a batch input session.   We need to submit the program and the batch session in back ground. How to do it? 
       would you please help me with the questions, couldn't thank you more.
       Best regards
                                                                          Frank

    Hi
    Batch Input Session:
    BATCH INPUT SESSION is an intermediate step between internal table
    and database table. Data along with the action is stored in session
    ie data for screen fields, to which screen it is passed, program
    name behind it, and how next screen is processed.
    Three processing modes of executing Batch Input Session :-
    Run Visibly : You can correct faulty transactions online & work step-by-step through  the transactions not yet executed.
    Display Errors only : You can correct faulty transactions online.   Transactions not yet executed, but without error, run in the background.
    Run in Background .
    2) What is the alternative to batch input session?
    Call transaction.
    3) An ABAP program creates a batch input session. We need to submit the program and the batch session in back ground. How to do it?
    go to SM36 and create background job by giving
         job name,job class and job steps (JOB SCHEDULING)

  • Please help me with this question..

    Hi everyone,
    Sorry for asking the same question which was posted many times in this forum.
    I have the following scenario..
    Database name: database1
    schema names: schema1
                  schema2
                  schema3
                  schema4
                  schema5
                  schema6
                  schema7
    workspace is with: schema1
                       schema2
    1. can i create 1 application that need to access tables in both schema1 and schema2 ?
    comments: I think we have to choose "parsing schema" when i am creating an application.
              if i choose the parsing schema as "schema1".
    2.how can i create a "form on a table" or some other wizard based forms which is in schema2?
    3.what priviliges do i need to create "form on a table" or some other wizard based forms which is in schema2?
    4.As my workspace is with schema1 and schema2. How can i create "forms" on tables which are in
    schema3? do i need to "create a view of table in schema3"  in schema1?
    All the above question will raise if i have to create forms or reports with "wizards". Is this stmt correct?
    I mean if i create a form "manually" all i need to look whether i have insert,update and delete priv on
    that object? is it correct?i think this question was answered several times.sorry for the repost.
    Thanks

    It is not necessary to say "please help me" since help comes almost always. Maybe sometimes you need to bump your question after a while. However, back to your question. I can tell you how I solve that problem:
    granting select, insert, update, delete on all tables to the parsing schema
    granting select on all views to the parsing schema
    granting execute on all procedures and packages to the parsing schema
    creating synonyms in the parsing schema for all tables, views, sequences, etc.
    You can do all of this programatically in a loop instead of writing it for each object separatelly.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    ------------------------------------------------------------------------------

  • Please help, oracle 8i on windows xp?

    Can oracle 8i run on windows xp?
    When I tried to run setup, it did abolutely nothing. I can't find any information on oracle's web site about this and the only relevant forum post that I found was by someone that was having the exact same problem, but no one answered him.
    Thanks in advance,
    Joey

    Hi all,
    I'm trying to install Oracle 8i on Windows-xp
    Professional. it gets installed but runs only once.
    that means its fails to run once I shut down the
    system and restart & shows the message-"oracle not
    found" or "tns server is not found". Can anybody
    please help me? Thanks in advance.When attempting to install obsolete software on modern operating systems, one must expect problems. I've found that Oracle tends to survive well when installed on a supported platform which is upgraded, but there are usually issues when attempting a fresh install on a newer platform.
    Your problem states "Oracle Not Found". Therefore your OS services know that they should be attempting to connect to an Oracle database but the database is 'not found'. Further, it says that the TNS Server is not found. TNS is Oracle's term for 'on the network'.
    Is there a business reason that requires you to run obsolete software? If the database software MUST be obsolete, what is the logic behind upgrading the operating system? (In other words - why only upgrade one?)
    You need to check the following things:
    1) You have a static IP address and host name, and are NOT using DHCP;
    (look at or post the result of command line "ipconfig /all")
    2) Check whether the Oracle database service and the listener service are running;
    (Under "Start > Settings > Control Panel > Administration Tools > Service" or command line services.msc)
    3) Tell us how well the listener is running;
    (Command line "lsnrctl status")

  • HT5312 Please help forgot the security question.. And no list: forgot security question? Send to your rescue email to....  Please help me...

    Please help me... Just forgot my security question.. N no list  forgot security question? Send to email ....... Below.. Only the question sould answer..  Please help me...

    Try going to the ExpressLane at https://expresslane.apple.com and then iTunes, iTunes Store, Password and Security Questions and select the Rescue Email to have that resent to you.

  • Please help me with this question ftp

    please help me to continue i don't know how to finished
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.net.URL;
    public class myftp2 {
    static String host = null;
    static String path = "/";
    public static void main(String[] args) {
    if(args.length != 1) {
    usage();
    System.exit(1);
    host = "ftp://"+args[0];
    if( ! isOpen() )
    System.out.println("Cannot connect to "+host+path);
    System.exit(1);
    System.out.println("Connected to "+host+path);
    BufferedReader kb = new BufferedReader( new InputStreamReader(System.in));
    boolean finished = false;
    while( ! finished ) {
    String input;
    String[] cmdArgs;
    System.out.print("myftp> ");
    try {
    input = kb.readLine();
    cmdArgs = input.split("
    s");
    if(cmdArgs[0].equals("exit") ) {
    finished = true;
    else if( cmdArgs[0].equals("dir")) {
    dirCommand();
    else if (cmdArgs[0].equals("get"))
    else if( cmdArgs[0].equals("pwd")) {
    System.out.println(host+path);
    else if( cmdArgs[0].equals("cd")) {
    if(cmdArgs.length!= 2) {
    System.out.println("You must include the directory name");
    else
    cdCommand(cmdArgs[1]);
    else if (cmdArgs[0].equals("cd.."))
    //cdCommand(cmdArgs[1]);
    catch(IOException e){
    System.out.println("Goodbye");
    static void usage() {
    System.out.println("Usage: java myftp <hostname>");
    System.out.println("please write your username:password@<hostname>");
    static boolean isOpen() {
    try {
    URL url = new URL(host+path);
    InputStream in = url.openStream();
    in.close();
    catch(IOException e) {
    System.out.println(e.getMessage());
    return false;
    return true;
    static void dirCommand() {
    String line;
    try {
    URL url = new URL(host+path);
    InputStream in = url.openStream();
    InputStreamReader inStr = new InputStreamReader(in);
    BufferedReader inNet = new BufferedReader(inStr);
    while((line = inNet.readLine()) != null)
    System.out.println(line);
    catch(IOException e) {
    System.out.println("Error: cant list the directory");
    static void cdCommand(String directory) {
    static void cdCommandback(String dir)
    }

    Please stop crossposting this question.
    http://forum.java.sun.com/thread.jspa?threadID=5253698&messageID=10050532#10050532

  • My ipod touch is disabled. Please help me with my questions. It is my first apple device.

    My ipod is disabled. When i turn it on it says to connect to itunes. I can get to where the screen displays a cord and an itunes logo, but itunes does not pop up, nor display my devices. This is probably because I have not synced my ipod with this computer, nor with any computer. How do I sync my ipod with itunes when it is disabled? How do I get itunes to pop up when my ipod is connected to the computer? Please dont give me a link, i really would like a step by step guide. I have itunes downloaded on this computer, but it does not pop up or display my devices. Do I need to create an itunes account? I have so many questions because this is my first apple device. If you were wondering, my ipod touch is disabled because I forgot my passcode. PLEASE help, I dont care if I have to reset my ipod, I just want to be able to use it!

    Use Device Firmware Mode...
    1.     Turn off your ipod To do this, hold the home and sleep buttons for 10 seconds, ignore slide to power off message.
    2.     Release the power button when you see the apple logo (keep holding the home button)
    3.     Keep holding until you see a message.
    Now restore from a backup!
    Alternatively you can wait!

  • Please-Help with SQL NewBee

    Hello please help me with an sql, I have a table with 2 fields, I want to check if one of the field is blank, mining that it dosn't contain anything.
    if table called Test has 2 fields name ,age.
    how do I check in sql if age is blank.
    thanks

    Are you trying to do this through mSQL in Lite?
    - Junius

  • Please HELP! Music Player Question!

    I have a music player that I am working on. Here is a link to
    the site
    Omyda Player. If you
    click the little blinking arrow it reveals a control panel. Then
    when you press track selector a window within the flash movie, you
    can then chose a track and it will play. Do to the players slim
    size the fonts have to be made small, so small its hard to read
    unless you have good eyes. What I wanted to do is make it so that
    if you hit track selector it pops up a html pop up window. You can
    then choose your track and it sends the request to the flash
    player. I was thinking of going about it this way!
    I have to use java to send a command to the flash player....
    here is the code.
    The code above actually sends commands to what ever flash
    movie you designate, problem is it is only made to send go to frame
    commands.
    Part 2 is the java button.
    Now how do I name the home.html page? I know how to do a
    window with in a window, but not a pop up to a page. Say for
    example the popup is popup.html, how do I name the home.html. Do I
    simply put home.html in target? Part 3 is an example, Is this
    correct? If not how do I do it?
    Now here comes an issue with the flash. The java code above
    goes to a frame within the movie. So now I have to make a script on
    frame 3 of the movie that tells it to make a button press, but I do
    not know how to do it. Originally the movie worked by pressing a
    button that was marked as a button set as a target called
    Selection1 and so on. How would I make a script on frame 3 that
    would press the button on its own? Kinda like a simulated user
    press. Or is there a way to edit the Java code to act as a button
    press? Please HELP! Part 4 is the coding used in the player!

    Its called telling you the forum rules.
    Now for your question, when you say the phone tells the caller that you are engaged, is it the "busy" tone or it diverts the caller to your voice mail box? 
    If you find my post helpful please click the green star on the left under the avatar. Thanks.

  • PLEASE HELP IN ANSWERING FEW QUESTIONS

    Hello Experts,
    i have few questions, could you please help me in getting familiar to this:
    1. What is Enterprise Structure?
    2. What is Organisational unit for for all SAP modules?
    3. can one chart of account can be assigned to more than one company code?
    4. how many company codes can be assigned to single company?
    5. All versions of SAP Till Now?
    Thanks!!

    Im pretty new to all this too, but this is how you validate an XML file against a XSD:
    You need to set the features of youre parser so that it is ready to validate.
    You will also need to extend the SAXErrorHandler with youre own CustomErrorHandler,
    parser.setFeature("http://apache.org/xml/features/validation/schema", validate);
    parser.setFeature("http://apache.org/xml/features/validation/schema-full-checking", validate);
    parser.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation", schemaUrl);
    CustomerErrorHandler handler = new CustomErrorHandler()
    parser.setErrorHandler(handler);
    parser.parse(xmlFiles);The XML file then needs t o have a reference to the XSD that is needs to be validated against at the top of the file:
    xsi:schemaLocation="http://www.w3schools.com c:\\WINNT\Desktop\youreXSD.xsd
    I think you will also need to catch and handle at least the SAXException....
    Hope this helps,

  • Oracle SQL Developer question

    Not using SQLPlus, so don't suggest to use.
    In Oracle SQL Developer, I'd like to set up an SQL statement so that the user is prompted for a portion of the query condition? Is this possible, if so kindly provide example :)P

    user11210446 wrote:
    Not using SQLPlus, so don't suggest to use.
    In Oracle SQL Developer,
    Not using right forum, so suggest you use that.
    SQL Developer

  • Please help - Oracle Apps related

    Hello,
    First of all I’m really sorry if I’ve posted this question on wrong thread. I am unable to get any category related to Oracle Apps.
    If there is any particular thread concerned to Oracle Apps then please let me know.
    My senior has asked me few question related to oracle application:-
    Q1 – What happens when we connect Oracle Apps through URL . How the URL connects it to apps. What are all background process to do so . Names with their workings. (Start level from the first login page)
    Q2 – What are JSP, APACHE & HTML in Oracle. How do jsp, apache and html pages related to oracle apps connection. How do they work.
    Q3 – What happens if the oracle apps page is not connecting, hangs or shows blank screen. How will you solve the same.
    Q4 – what are in folder 10.1.2 and 10.1.3. What are they meant for and how do they work.
    Q5 – What is the difference between Oracle home for 10g RDBMS / oAS 10.1.2 ORACLE HOME / oAS 10.1.3 ORACLE HOME and their contents.
    Q6 – What are in Instance top and their uses.
    Q7 – Complete Oracle apps architecture and its complete descriptions with workings.
    I will be very grateful for any help in this case.
    Regards

    Hi;
    Q1 – What happens when we connect Oracle Apps through URL . How the URL connects it to apps. What are all background process to do so . Names with their workings. (Start level from the first login page)Check below threads:
    Full cycle ...
    Re: Full cycle ...
    Q2 – What are JSP, APACHE & HTML in Oracle. How do jsp, apache and html pages related to oracle apps connection. How do they work.You need to read concept guide:
    tüm notlar2
    For r12.1.1:
    http://download.oracle.com/docs/cd/B53825_01/current/html/docset.html
    For r12:
    http://download.oracle.com/docs/cd/B40089_10/current/html/docset.html
    For r11:
    http://download.oracle.com/docs/cd/A60725_05/r11_doc.htm
    Q3 – What happens if the oracle apps page is not connecting, hangs or shows blank screen. How will you solve the same.You need to check apache log file or you should check apache and other service up &running. If not you need to check apache log files
    Q4 – what are in folder 10.1.2 and 10.1.3. What are they meant for and how do they work.Check concept guide
    Q5 – What is the difference between Oracle home for 10g RDBMS / oAS 10.1.2 ORACLE HOME / oAS 10.1.3 ORACLE HOME and their contents.There are 3 homes in EBS. Check concept guide :)
    Q6 – What are in Instance top and their uses.Check concept guide :)
    Q7 – Complete Oracle apps architecture and its complete descriptions with workings.Check concept guide :)
    As you can see You need to start to read concept guide. All your question answer is there. I can answer your question but it will not help you. If you inerested to become app dba you must know concept, component of ebs and their relation. Those topic cover in concept guide
    Read first. If you have still question than update thread ;)
    Regard
    Helios

  • PLEASE HELP, I have 3 questions...

    Okay, so I just bought my 30GB Ipod and have a few nube questions.
    1. How can I scan the ipod for viruses?
    2. Is it normal that with no music on the ipod it says i have something like 28 or 27 gigs available? Is this space just used up by games and other applications that come previously installed?
    3. For albums that are loaded onto the ipod I have assigned them album art, these are displayed when I play the songs in my itunes, but they dont display while playing the album on my ipod. HELP PLEASE AND THANK YOU!!

    1) As far as I know, viruses aren't an issue for iPods.
    2) This is normal because of the way manfacturer's calculate hard disk space. See the explantion at the bottom of this link.
    http://docs.info.apple.com/article.html?artnum=60955
    3) Sorry really can't help since I'm on a Mac, but I do know that playlists have nothing to do with displaying album art.

  • Please help about sql

    Hi, I want to search for account balance that is less than $10.00 from my database. My account balance is in 'varchar'.
    I try to use the following sql statemennt but it's not working, can anybody tell me the correct sql statement?
    String balance="10.00";
    SELECT * FROM ACCOUNT WHERE balance < '"+balance+"'

    Hi, thanks mohan for answering my question. I solve my problem in another way. Bu now , I have problem with the following sql statement, please check for me.
    I want to display the account info where the account balance is less than 10.00.
    my ACCCOUNT table
    account number customer_id admin_id balance interest_rate start_date
    123456     1234     1     5.00 3.21     5/11/2001
    <%@ page import="java.sql.*"%>
    <%try
         String url = "jdbc:jrun:sqlserver://127.0.0.1:1433;databaseName=bank";;;
         Class.forName("allaire.jrun.jdbc.JRunDriver").newInstance();
         Connection conn=
         DriverManager.getConnection(url,"sa","bepyng");
         String sql = "SELECT customer_id,account_num,balance,start_date,interest_rate FROM ACCOUNT WHERE balance < 10.00";
         Statement stmt = conn.createStatement();
         ResultSet rs = stmt.executeQuery(sql);
         while(rs.next())
              String id = rs.getString(1);
    %>
    <%=id%>
         <table width="63%" border="0" align="center" bordercolor="#000000" bgcolor="#FFFFFF">
    <tr>
    <td>Customer ID</td>
    <td><%=rs.getString("customer_id")%></td>
    </tr>
    <tr>
    <td width="42%">Account Number</td>
    <td width="58%"><%=rs.getString("account_num")%></td>
    </tr>
    <tr>
    <td>Balance</td>
    <td><%=rs.getString("balance")%></td>
    </tr>
    <tr>
    <td>Start Date</td>
    <td><%=rs.getDate("start_date")%></td>
    </tr>
    <tr>
    <td>Interest Rate</td>
    <td><%=rs.getString("interest_rate")%></td>
    </tr>
    </table>
    <%}          
    catch(Exception e)
         System.out.println("An error occurred while connecting to onlinebanking database!"+e.getMessage());
    %>
    but I don't get anything, why?
    Thanks in advance.

Maybe you are looking for