Simple Question - SQL Query

List the branch number and names of shops which do not have any books written by Pratt in stock. Order the list by branch number.
how can I code this? if that statement was positive, i would say something like "where ..... author_last IN ('Pratt')"
But in this case, how can I do it? i don't think there's a command like "OUT" in SQL :)

Hi,
If you how how to find the shops that DO have such books, then you're off to a good start!
Make a NOT EXISTS or NOT IN sub-query.
For example, in the scott.dept table, if you wanted to find all the departments that do not have any salesmen working in them (as found in the scott.emp table):
SELECT  *
FROM    scott.dept
WHERE   deptno  NOT IN ( SELECT  deptno
                         FROM    scott.emp
                         WHERE   job  = 'SALESMAN'
;"NOT IN" is sort of like "OUT".

Similar Messages

  • Simple Pl/SQL query -

    Hi,
    This might be a simple question, I am new to Pl/SQL ,
    I have a table which consists of two columns deal_id and freq.
    for each deal_id there might be number of freq. The table something looks similar ltoo this,
    deal_id freq
    10 1.1
    10 1.2
    12 1.1
    12 1.2
    14 1.1
    14 1.2
    14 1.3
    16 1.5
    16 1.5
    Now if a deal_id selected has freq 1.1 and 1.2 , it should display output has 'MA only'
    if a deal_id selected has freq other than 1.1 and 1.2 , it should display 'Not MA'
    else if it has like deal_id 14 should display . 'Both Ma and Non MA'
    I wrote a query like this,
    select
    deal_id
    , case
    When Freq In (1.1 , 1.2) Then 'MA Only'
    When Freq Not in (1.1 , 1.2) Then 'Non-MA Only'
    Else 'Both Ma and Non-Ma'
    End freq_dt
    from sample_Table
    where ia.deal_id= '14'
    O/P i get is
    deal_id freq_dt
    14 MA only
    14 MA only
    14 Non MA only
    But i should get O/p like
    deal_id freq_dt
    14 Both MA and Non Ma
    Any help will be greatlt appreciated.
    Thanks,
    Vin

    Thanks Guys, for all your valuable suggestions.
    These forums are helping me a lot.
    Ok, back to the question, after going thru all the posts, i worked out on the query at work for a while and edited it something like this,
    Select
    case
    when count(distinct freq_dt)>1 Then 'Both MA and Non-MA only'
    Else <......>(pl refer below)
    end status
    from
    (select
    ia.deal_id
    , case
    when Freq In (851.0125, 851.5125, 852.0125, 852.5125, 853.0215) Then 'MA Only'
    When Freq Not in (851.0125, 851.5125, 852.0125, 852.5125, 853.0215) Then 'Non-MA Only'
    Else 'Both Ma and Non-Ma'
    End freq_dt
    from repl_site_freq ia
    where ia.deal_id='65'
    No worries, I know the query looks like useless, but I am working, I am new to Oracle,
    and what i have done is performed a distinct count on the subquery.
    Now if count >1 , i mean there is MA and Non-MA so it displays both MA and Non MA. Its working fine.
    But now if count = 1, i mean if the whole subquery table has either MA or NOn-MA , then how can i catch that .
    I mean if count =1, O/p shud be MA only if all are MA
    and NON-MA if all are Non-MA.
    Now I want to put this query in the else statement above
    select st from
    select
    ia.deal_id
    , case
    when Freq In (851.0125, 851.5125, 852.0125, 852.5125, 853.0215) Then 'MA Only'
    When Freq Not in (851.0125, 851.5125, 852.0125, 852.5125, 853.0215) Then 'Non-MA Only'
    Else 'Both Ma and Non-Ma'
    End st
    from repl_site_freq ia
    where ia.deal_id='32434'
    A where rownum < 2
    since this subquery just returns count=1, and i want to display the first item in first row of first column which can be either MA or NOn-MA
    when i put the above quesry in else, it returns me some error, like groupby missing.
    ANy help will be greatly appreciated.
    Thanks,
    Vin

  • A simple T-SQL Query

    I am using SQL 2008. I have following table.
    HostName
    Timestamp
    ErrorType
    Server 1
    2014-03-11 00:10:39.387
    N/W Error
    Server 2
    2014-03-11 01:10:40.387
    DB Error
    Server 1
    2014-03-11 00:20:39.387
    N/W Error
    Server 2
    2014-03-11 02:10:40.387
    N/W Error
    Server 2
    2014-03-11 02:00:39.387
    N/W Error
    Server 1
    2014-03-11 03:30:39.387
    N/W Error
    Server 1
    2014-03-11 03:45:39.387
    N/W Error
    Server 1
    2014-03-12 13:45:39.387
    N/W Error
    Server 2
    2014-03-12 14:45:39.387
    DB Error
    I would like to get how many errors occur per hour per server in a particular day. . So basically I will just pass date (such as 2014-03-11) in my query and it will be below report.
    But I am not sure how to get it. Any help would be appreciated
    HostName
    NumberofError
    Time
    Errortype
    Server 1
    2
    12 AM
    N/W Error
    Server 2
    1
    1 AM
    DB Error
    Server 2
    2
    2 AM
    N/W Error
    Server 1
    2
    3 AM
    N/W Error
    Thanks

    Use a table of time slots set to one more decimal second of precision than your data. You can now use temporal math to add it to a DATE to TIME(1) get a full DATETIME2(0). Here is the basic skeleton. 
    CREATE TABLE Timeslots
    (slot_start_time TIME(1) NOT NULL PRIMARY KEY,
     slot_end_time TIME(1) NOT NULL,
     CHECK (start_time < end_time));
    INSERT INTO Timeslots  --15 min intervals
    VALUES ('00:00:00.0', '00:14:59.9'),
    ('00:15:00.0', '00:29:59.9'),
    ('00:30:00.0', '00:44:59.9'),
    ('00:45:00.0', '01:00:59.9'), 
    ('23:45:00.0', '23:59:59.9'); 
    Here is the basic query for rounding down to a time slot. 
    SELECT CAST (@in_timestamp AS DATE), T.start_time
      FROM Timeslots AS T
     WHERE CAST (@in_timestamp AS TIME)
           BETWEEN T.slot_start_time 
               AND T.slot_end_time;
    Also, please stop using AM/PM and learn ANSI/ISO Standards. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Simple dumb sql query

    New user here and I haven't been able to find an answer to this. My table looks like
    Name Code Date Issued Date Returned
    Smith 22 10/05/05 10/10/05
    Smith 3 10/05/05 10/06/05
    Smith 102 10/10/05 10/12/05
    Jones 1 10/10/05 10/11/05
    Code is unique. I want a report for each user that looks like
    Smith 3 10/05/05 10/10/05
    22 10/05/05 10/06/05
    102 10/10/05 10/12/05
    Where the column "Name" does not repeat the value. I have tried various combinations of order by but can't get "name" to stop repeating, and have searched the FAQs and docs but can't find how to do this...I'm sure it's something simple I'm not seeing...thanks in advance

    create table mytable (
        name        varchar2(20)
    ,   code        number
    ,   date_issued date
    ,   date_returned date)
    insert into mytable values ('Smith', 22, to_date('10/05/05','MM/DD/YY'), to_date('10/10/05','MM/DD/YY'))
    insert into mytable values ('Smith', 3, to_date('10/05/05','MM/DD/YY'), to_date('10/06/05','MM/DD/YY'))
    insert into mytable values ('Smith', 102, to_date('10/10/05','MM/DD/YY'), to_date('10/12/05','MM/DD/YY'))
    insert into mytable values ('Jones', 1, to_date('10/10/05','MM/DD/YY'), to_date('10/11/05','MM/DD/YY'))
    select  decode(grp_rn, 1, name, null) name
    ,       code
    ,       date_issued
    ,       date_returned
    from    (   select  m.*
                ,       row_number() over (partition by m.name order by m.name, m.code) grp_rn
                from    mytable m
    NAME     CODE     DATE_ISSUED     DATE_RETURNED
    Jones     1     10/10/2005     10/11/2005
    Smith     3     10/5/2005     10/6/2005
         22     10/5/2005     10/10/2005
         102     10/10/2005     10/12/2005Message was edited by:
    splazm

  • Simple max() sql query

    Dear SQL Experts
    i have data like below
    id rate date
    1 10 03-JAN-2010
    1 20 02-JAN-2010
    1 30 01-JAN-2010
    2 10 01-JAN-2010
    2 20 02-JAN-2010
    2 30 10-JAN-2010
    3 40 01-JAN-2010
    3 50 15-JAN-2010
    3 60 03-JAN-2010
    I want to get the id wise last date's rate. like below
    id rate date
    1 10 03-JAN-2010 (As 3rd Jan is the max date)
    2 30 10-JAN-2010 (As 10th Jan is the max date)
    3 50 15-JAN-2010 (As 15th Jan is the max date)

    You can use the following to avoid the subquery:
    SQL> WITH DATA AS(
      2  select 1 ID1,10 RATE,to_date('03 jan 2010','DD MON YYYY')DATE1 from dual UNION ALL
      3  select 1 ID1,20 RATE,to_date('02 jan 2010','DD MON YYYY')DATE1 from dual UNION ALL
      4  select 1 ID1,30 RATE,to_date('01 jan 2010','DD MON YYYY')DATE1 from dual UNION ALL
      5  select 2 ID1,10 RATE,to_date('01 jan 2010','DD MON YYYY')DATE1 from dual UNION ALL
      6  select 2 ID1,20 RATE,to_date('02 jan 2010','DD MON YYYY')DATE1 from dual UNION ALL
      7  select 2 ID1,30 RATE,to_date('10 jan 2010','DD MON YYYY')DATE1 from dual UNION ALL
      8  select 3 ID1,40 RATE,to_date('01 jan 2010','DD MON YYYY')DATE1 from dual UNION ALL
      9  select 3 ID1,50 RATE,to_date('15 jan 2010','DD MON YYYY')DATE1 from dual UNION ALL
    10  select 3 ID1,60 RATE,to_date('03 jan 2010','DD MON YYYY')DATE1 from dual )
    11  Select id1, max(rate) keep(dense_rank last order by date1) rate, max(date1) date1
    12  from data
    13  group by id1;
           ID1       RATE DATE1
             1         10 03-JAN-10
             2         30 10-JAN-10
             3         50 15-JAN-10Max

  • Pl help with simple pl/sql quey

    Hi ,
    I am getting stuck with this simple pl/sql query , can anyone pl help me with this.
    This is the query i have,
    select ia.deal_id, actual_clear_dt
    from inc_site_freq isf
    join INC_ASSET ia on isf.inc_asset_id = ia.inc_asset_id
    and freq in (866.0125, 866.5125, 867.0125, 867.5125, 868.0125)
    and deal_id=21363
    the above query displays data of about 10 rows which may or may not have combination of null and dates for actua_clear_dt.
    if its a combination of null and dates then all the actual_clear_dt should be null
    if it has only dates should display all dates
    Please help. Thanks.

    Vin wrote:
    Hi ,
    I am getting stuck with this simple pl/sql query , can anyone pl help me with this.
    This is the query i have,
    select ia.deal_id, actual_clear_dt
    from inc_site_freq isf
    join INC_ASSET ia on isf.inc_asset_id = ia.inc_asset_id
    and freq in (866.0125, 866.5125, 867.0125, 867.5125, 868.0125)
    and deal_id=21363
    the above query displays data of about 10 rows which may or may not have combination of null and dates for actua_clear_dt.
    if its a combination of null and dates then all the actual_clear_dt should be null
    if it has only dates should display all dates
    Please help. Thanks.A little indention/formatting would help you see and comprehend it better, and including the { code } tags when posting here would help US see and comprehend it better:
    select
      ia.deal_id,
      actual_clear_dt
    from
      inc_site_freq isf
    join INC_ASSET ia
      on isf.inc_asset_id = ia.inc_asset_id
      and freq in (866.0125,
                   866.5125,
                   867.0125,
                   867.5125,
                   868.0125)
      and deal_id=21363

  • A simple SQL query question

    I have an interesting problem and wondering how I can get this result in a single SQL query:
    Here is table emp has data with a row for every year since the employee joined with the salary paid that particular year with following columns:
    emp (
    id varchar2(10),
    name varchar2(25),
    interested_year date,
    salarypaid number(10)
    I would like to print the results as follows:
    id name previousyear_salarypaid currentyear_salarypaid
    x xxxxx xxxxxx xxxxx
    Is this possible to do? I have tried to simplify my actual problem so I hope I have included all necessary details.

    Just to clarify, the columns mentioned in the results are
    previousyear_salarypaid is nothing but
    salarypaid where interested_year = '2007'
    currentyear_salarypaid is nothing but
    salarypaid where interested_year = '2006'

  • Probably a simple SQL Query - Newbie

    I want to select entries from a table that has 2 columns where the first column value is contained within the 2 column....Does that make sense?
    The first is a varchar that contains a value for a customer. The second is a varchar that contains a a textual description of a problem the customer has. My problem is that I only want to select the entries in the table where the second column contains a description that includes the first column value.
    eg. I want to select rows that have the following condition:
    column1 has value of "customer1"
    column2 has a value of "an error was reported by customer1 on service blah"
    but not these
    column1 has value of "customer1"
    column2 has a value of "an error was reported by customer2 on service blah"
    This is probably a simple question but I've spent time looking at how to do it and can't seem to manage...any help would be appreciated....Thanks

    Hi Barbara,
    I've never used the CONTAINS operator before. I compared the use in this situation to the other methods and found the others to be FAR less resource intensive, despite working on unindexed columns, as I demonstrate below.
    It would seem that CONTAINS is unsuited to this type of simple query. Can you shed any light on this, from the perspective of somebody who has used it before? Is this type of performance penalty normal? If so, it could seem that CONTAINS is fairly useless next to LIKE.
    [email protected]> desc test;
    Name                                        Null?    Type
    COLUMN1                                              VARCHAR2(20)
    COLUMN2                                              VARCHAR2(100)
    [email protected]> select count(*) from test;
      COUNT(*)
         10000
    Elapsed: 00:00:00.00
    [email protected]> select * from test where instr(column2, column1) > 0;
    10000 rows selected.
    Elapsed: 00:00:00.18
    Execution Plan
       0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=23 Card=8328 Bytes=532992)
       1    0   TABLE ACCESS (FULL) OF 'TEST' (TABLE) (Cost=23 Card=8328 Bytes=532992)
    Statistics
              5  recursive calls
              0  db block gets
            821  consistent gets
              0  physical reads
              0  redo size
         702263  bytes sent via SQL*Net to client
           7838  bytes received via SQL*Net from client
            668  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          10000  rows processed
    [email protected]> select * from test where column2 like '%'||column1||'%';
    10000 rows selected.
    Elapsed: 00:00:00.18
    Execution Plan
       0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=23 Card=8328 Bytes=532992)
       1    0   TABLE ACCESS (FULL) OF 'TEST' (TABLE) (Cost=23 Card=8328 Bytes=532992)
    Statistics
              5  recursive calls
              0  db block gets
            821  consistent gets
              0  physical reads
              0  redo size
         702263  bytes sent via SQL*Net to client
           7838  bytes received via SQL*Net from client
            668  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          10000  rows processed
    [email protected]> create index testidx on test(column2) indextype is ctxsys.context;
    Index created.
    [email protected]> select * from test where contains(column2, column1) > 0;
    10000 rows selected.
    Elapsed: 00:00:56.80
    Execution Plan
       0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=25008 Card=4 Bytes=284)
       1    0   TABLE ACCESS (FULL) OF 'TEST' (TABLE) (Cost=25008 Card=4 Bytes=284)
    Statistics
          55201  recursive calls
              0  db block gets
          85857  consistent gets
              0  physical reads
              0  redo size
         702263  bytes sent via SQL*Net to client
           7838  bytes received via SQL*Net from client
            668  SQL*Net roundtrips to/from client
            204  sorts (memory)
              0  sorts (disk)
          10000  rows processedThanks in advance,
    Anthony

  • Your estimated performance of a very simple SQL query

    Hi there..
    Sometimes it seems hard to find answers for the most simple questions so I hope you can help me and be overbearing ;)
    I am going to have a table with a few million records in it, 30-40 columns of which 80% has data, indexes on maybe 10 columns (certainly the columns I am querying), less than ten thousand new records a day with a variety of different column values and using Oracle 10 or 11.
    I am going to be running a single SQL SELECT statement quite regularily against these records to retrieve all records whose value of a single column is the same (and specified in my WHERE clause)
    It will be a query like this; SELECT * FROM person where city = 'Amsterdam' AND
    The column 'city' will have a simple index on it. 4-8 records will have the same value (e.g. there will only be up to 8 rows where city is 'Amsterdam' in the above example) which means that with 5 million records I will probably have between 625,000 and 1,250,000 "sets" that I am querying and retrieving per SQL. Thed atatype could be varchar or number - not sure yet.
    I will retrieve the same data a lot but generally also access all the other data on a regular basis.
    How should I expect this to perform? Always fast I imagine because will there will be any table scans do we think? I don't have to think about partitioning of too regular statistic calculation or anything? Anything to watch out for?
    Any feedback would be greatly appreciated.
    Thanks a lot in advance.
    Daniel

    It's impossible to tell without seeing a true structure and indexes etc.
    It sounds ok at a first read. High selectivity, low cardinality, low skewing. Obviously, ensuring stats are up to date on a reasonably regular basis is a good idea, especially with 10,000+ records added daily. I would expect it to perform ok.

  • Question about using objects in SQL query.

    I had posted this question in the SQL/PLSQL forum but I guess nobody took the time to understand exactly what I am asking so I decided to try here hoping to get the answer. So here is the thing:
    I have created generic object type "tree" - the constructor takes as a parameter sql query which returns "node_id" and "parent_node_id" - this is all we need to have a tree. The object has all related to a tree structure member functions and one of them is "oldest_relative" (the tree may not be fully connected - it may be more like a set of many trees, so it's not necessary all nodes to have the same root).
    I also have departments table with the following fields: department_id, parent_department_id, department_name,...
    all records in the table w/out parent_departments (parent_department_id is null) are considered divisions.
    Now if I run the following query:
    SELECT "DEPARTMENT_ID", "PARENT_DEPARTMENT_ID", "DEPARTMENT_NAME", tree('select department_id "node_id", parent_department_id "parent_node_id" from departments').oldest_relative("DEPARTMENT_ID") "DIVISION_ID" FROM departments
    my question is: Is the tree object created for every row or does Oracle somehow caches the object since the object itself is not changing but only the parameter for the oldest_relative member function.
    The table only has a few hunderd records and I can't see much of a difference in the execution time btw the query above and query like this:
    SELECT "DEPARTMENT_ID", "PARENT_DEPARTMENT_ID", "DEPARTMENT_NAME", b.t.oldest_relative("DEPARTMENT_ID") "DIVISION_ID"
    FROM departments left join (select tree('select department_id "node_id", parent_department_id "parent_node_id" from departments') t from dual) b on 1 = 1
    where the object is clearly created just ones. (there is probably a better way to do it instead of this join)
    Pls elaborate
    George

    Not exactly sure what the question is...
    As I understand, you are comparing the following two constructor calls:
    +select..  tree('select department_id "node_id", parent_department_id "parent_node_id" from departments').oldest_relative("DEPARTMENT_ID") ... FROM ...+
    +select tree('select department_id "node_id", parent_department_id "parent_node_id" from departments') ... FROM dual+
    These calls are the same (besides the 1st one doing an immediate implicit call to a method of the object being constructed). The number of times these are being called depends on the number of times this SQL projection is applied - and that is determined by the number of rows being projected by the SELECT.
    The latter one is against DUAL which only has a single row. So that constructor is only called once. The former can be against multiple rows. Obviously a single pass through a data set is desirable - which means that the sub-select (use by the constructor) should ideally only be executed once and makes the 2nd method more desirable.
    However, I'm having a hard time understanding why the class and constructor are at all needed. Why pull data from a SQL table into PL memory? As that is where the class will need to cache and store the results of that construction parameter SQL SELECT. And once in PL memory, how does the object effectively access, search and use this cached data?
    PL memory is expensive. It is not sharable.
    PL data structures are primitive - these cannot be compared to SQL structures in the form of tables and columns that can be stored in a number of physical ways (index tables, hash tables, partitioned tables, clustered tables, etc). Cannot be indexed like SQL structures using B+tree, bitmap, function and other indexing methods. Cannot be sorted, grouped, analysed, filtered, etc like SQL structured data.
    It makes very little sense to read SQL data into a class and then deal with that data, cached in expensive PL memory, using primitive PL structures.
    And the same would be true if Java or C# was used. The best place for data is inside the SQL engine. That is the most superior environment for data. It can processes more data, scale better, perform better and offer more flexibility, than pulling data from it and then crunch that data using PL or Java or C#.

  • Simple SQL query SQL developer takes it, The wizzard of XE does not

    Hello everybody
    I wrote this simple query which SQL developer runs fine, but when I try to launch a Report based on this sql query it tells me invalid sql statement. That is true, it may be invalid because this IF clause in there..but SQL developer seems to be very tolerant or understands more...
    the reason I wrote that is because obviously if there are no bosses, ie = 0 then i would get an error when dividing it by 0, so I put that 0 just to select the good ones
    if count (bosses) >0
    select company, postcode,
    sum( bosses/staff)
    from evaluation
    group by company, postcode
    Thank you very much
    Alvaro

    oh yes (blushed in shame as how dumb i looked like) i knew about the denominator 0 and infinite as as result i just didnt notice my zero was on the numerator :(
    however, i run the query and i got this message in sql developer
    Error starting at line 1 in command:
    select company, postcode,
    case when staff != 0 then sum( bosses/staff) end
    from evaluation
    group by company, postcode
    Error at Command Line:2 Column:10
    Error report:
    SQL Error: ORA-00979: not a GROUP BY expression
    00979. 00000 - "not a GROUP BY expression"
    *Cause:   
    *Action:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Simpler reprsentation to SQL Query is needed

    Hi all,
    I have this SQL Query working goon on the Database but have some errors with Form developer so can anybody simplify it?
         SELECT *
                 FROM (SELECT   COUNT (returned_goods.ID) AS "Max Occurence", products.Name
                           FROM Returned_Goods
                           JOIN Products
                           ON returned_goods.productId = products.Id
                           GROUP BY returned_goods.productId, products.Name
                           ORDER BY COUNT (returned_goods.ID) DESC)
            WHERE ROWNUM = 1;btw, the error encounter me in Forms appears here if anybody can help: [SQL Code not working in Forms Developer without Functions|http://forums.oracle.com/forums/thread.jspa?threadID=842122&tstart=0]
    Thanks in advance :)

    The simpler SQL Staement is
    SELECT *
      FROM (SELECT   COUNT (returned_goods.ID) AS "Max Occurence", products.Name
      FROM returned_goods, products
         WHERE
         Returned_Goods.ProductId = Products.id
             GROUP BY returned_goods.productId, products.Name
             ORDER BY COUNT (returned_goods.ID) DESC)
    WHERE ROWNUM = 1;

  • Simple SQL Query and Parameters and LOV

    Newbie and trying to work thru building a simple sql query with a single table query and use a parameter and lov.
    Can anyone point me to an example.
    simple query:
    select cust_id, name_desc, name_add1, name_add2, name_city
    from customer_table
    where cust_id = :cust_parm
    This works in straight sql and in the query builder by prompting for the customer ID. When building a parameter using LOV or search, it doesn't seem to detect the variable.
    Thanks..
    DD

    If you are using version 11g, then as soon as you save the query in the data model, it should notice the parameter and ask if you want to add the parameter to the data model. What version of BIP are you using?
    What happens if you exclude the parameter from the query and simply hard-code the criteria? Can you generate XML data?
    From your wording, it sounds like you're trying to create a parameter from the LOV dialog. LOVs and parameters are totally distinct. After each are created separately, then you configure the parameter to use the LOV.

  • Simple SQL query statement is needed

    I need a simple SQL query to fetch records which is existed in all the departments.
    for example: i want to list the employees which are existed in each and every department.. not sure how should i get those.. will anyone help me please.. thanks in advance

    I think it would be wise to go to the following training:
    Oracle Database <version> : Introduction to SQL
    You will get the information you are looking for in five days. You can go find a tutorial on ANSI SQL, as advised by this board for free, to fix your immediate problem with a simple query. But, I personally recommend a more formal class specific to Oracle, as you will also get information about PL/SQL, and you get the benefit with working with other DBA/programmers when you are learning. This will solve your immediate issue, and any future issues with the language.
    You can find it in the Education section of the Oracle website.

  • SQL Query returns question marks

    I am seeing a SQL Query, executed via ADODB in VB, from a 10G client (don't know exact version) to a Sun Solaris based 9.2.0.5.0 Server return all question marks...Table queried consists of 3 columns, 2 varchar2, one long: Here query:
    SELECT SETTINGVALUE FROM EWORKFLO.CONFIG WHERE SETTINGGROUP='New test' AND SETTINGNAME='Single Page'
    The query results in 2576 question marks...(????? etc).
    Any idea what may be going on here?
    Thanks...
    Leendert

    Hello Tak,
    Thanks for replying. When this query is run from SQLPLUS we get a proper result back, that is the actual values from the SETTINGVALUE column. This is the LONG column and contains data like this:
    [Scan Section]
    DeviceTimeout=15
    Display=1
    hDCCreate=0
    Unit=0
    DialogTitle=
    IniFileName=c:\winnt\temp\kf.ini
    IniSectionName=Scan Section
    DeviceCache=1
    etc....etc....
    Depending on the settings created, the return string may vary in length.
    Leen

Maybe you are looking for