Select without where the condition

Hello

Is there is no why select lines of two albums without using a where condition.

-
Animesh

Animesh Tripathi says:
Hello

Is there is no why select lines of two albums without using a where condition.

-
Animesh

Without a doubt.

There are only two lines in your table and then just a Select will do the job. (I'm kidding ;-))

If you have a hierarchical data in your tables, it might be possible:

with employee as
(
  select 1 emp_id, 'ABC' ename, to_date('01-02-2013', 'DD-MM-YYYY') doj, null mgr_id from dual union all
  select 2 emp_id, 'ABC1' ename, to_date('02-02-2013', 'DD-MM-YYYY') doj, 1 mgr_id from dual union all
  select 3 emp_id, 'ABC2' ename, to_date('03-02-2013', 'DD-MM-YYYY') doj, 1 mgr_id from dual union all
  select 4 emp_id, 'ABC3' ename, to_date('04-02-2013', 'DD-MM-YYYY') doj, 2 mgr_id from dual union all
  select 5 emp_id, 'ABC4' ename, to_date('05-02-2013', 'DD-MM-YYYY') doj, 3 mgr_id from dual
)
select emp_id, ename, mgr_id manager_id, prior ename manager_name
  from employee
 start with mgr_id is null
connect by prior emp_id = mgr_id
       and level <= 2;

EMP_ID                 ENAME MANAGER_ID             MANAGER_NAME
---------------------- ----- ---------------------- ------------
1                      ABC
2                      ABC1  1                      ABC
3                      ABC2  1                      ABC 

Tags: Database

Similar Questions

  • case where the condition

    Hello
    I want to use the case (or decode etc.) in which a part of sql.
    I want to find the number of rows depending on where the conditions.
    For example, I have a table b, d, e, p and s are fields of this table.
    If the value of the field b is 1 then my condition clause that will be value fields d, e value fields
    If the value of the fields of b is 2 then my condition clause where the declaration will be p field value < s value fields.


    Select count (*) of A
    where
    (if b = 1 then) d, e
    (if b = 2 then) p < s

    How can I achieve this?
    where (b = 1 and d		   
  • How to move a selection without moving the pixels?

    G ' Day, I'm looking for the shortcut/best way to get around a selction in photoshop, without moving the pixels in the selection.  Basically, I want to use as an aid to painting airbrush selection and need to quickly move the selection WITHOUT affecting the actual image pixels.

    Thank you

    Try to hold down the M button to move the selection, while the brush is active.

    -Christmas

  • Can I repair my selection without leaving the tool to refine edge?

    Sometimes, when I'm cutting out images, I see a place where I need to squeeze a little towards the top of my selection.  Time often happens when I'm in the tool refine edge.  Normally, I leave the tool refine edge, make the settings on my selection and then return to the tool refine edge.

    Is there a way to make this tool improve the contour, so I must not leave this window to go back again?  Maybe a modifier key?

    What to do after you make the initial selection (usually with the Quick Selection tool), press the Q key to place the image in the quick mask.  This highlights the selected areas, making it easier to see if you have missed a few.  If the selection is likely to need some post improve the contour of fine-tuning, II verify decontaminate colors to force the output to "New layer with layer mask" so I can firm up an error with the layer mask.

    Something that I found to be a bad idea is to put a post selection refine edge in refine edge to correct errors.  That what is smooth on any detail of edge very well ruin the selection.  Much better to go back in history and do it again properly.

    Refine Edge is nowhere near the intuitive tool that they established when it was introduced, and almost all of the video tutorials that you see ideal object to use.  You almost never see someone trying to select hair from flyaway from a busy background, for example.  The tutorial by Martin Evening is the closest I can think of actually doing it.  It took me the age and age comfortable with refine edge, and I always find new ways to make it better.  Something that I hosted in recently turned on see the RADIUS to see if it encroaches too far in the selection, and if so, deleting some of them by painting with the ALT key.  If you disable Show RADIUS and artifacts, you went a little too far.  I find that this minimises this annoying thing where refine edge suddenly takes a bite out of what you want selected and makes it very thin.

  • Go to dynamic WHERE the condition in the slider accordingly.

    Hi all

    I am facing a problem with the cursor with dynamic WHERE condition in a function.

    Here's the FUNCTION:
    CREATE OR REPLACE FUNCTION EXCEPTION_MERGE(TABLE_NAME IN VARCHAR2, TAB_NAME IN VARCHAR2)
    RETURN VARCHAr2
    IS
    stmt_tabcols VARCHAR2(32767);
    v_columnname VARCHAR2(32767);
    CURSOR C1 IS 
    SELECT 'A.'||A.COLUMN_NAME ||' = '|| 'B.'||B.COLUMN_NAME COLUMN_NAME 
    FROM 
    (
    SELECT COLUMN_ID, COLUMN_NAME 
    FROM USER_TAB_COLUMNS 
    WHERE TABLE_NAME  = TABLE_NAME 
    AND COLUMN_NAME NOT IN ('ERROR_TAB_ID','ERROR_LOAD_DATE')
    ) A, 
    (
    SELECT COLUMN_ID, COLUMN_NAME 
    FROM USER_TAB_COLUMNS 
    WHERE TABLE_NAME = TAB_NAME
    ) B 
    WHERE A.COLUMN_ID = B.COLUMN_ID;
    BEGIN
    
    
    FOR TABCOL IN C1
    LOOP
        stmt_tabcols := stmt_tabcols ||TABCOL.COLUMN_NAME||',';
        
    END LOOP;
        stmt_tabcols := RTRIM(stmt_tabcols, ',');
        RETURN stmt_tabcols;
    END;
    SELECT EXCEPTION_MERGE('WC_W_TEST_FS','WC_W_TEST_FS_GBL') FROM DUAL;
    She throws, below error:
    ORA-06502 : PL/SQL : Numeric or value error : character string buffer too small
    If I REPLACE TABLE_NAME table_name with hard coded values, it works fine. Can someone look at the code and let me know the question.

    Published by: ace_friends22 on Sep 9, 2012 13:08

    The first function TABLE_NAME parameter has the same name as the column of USER_TAB_COLUMNS...
    Change the names of the parameters to say nom_table_p...

    Concerning

    Etbin

  • DBMS_XMLGEN. GETXML confusing WHERE the condition of clause?

    I can't quite wrap my head around that, but I found the following query

    Select * from user_views
    where dbms_xmlgen.getxml ("select text from user_views where view_name =" "|") view_name | ') like '% view_table_name % '.

    I am totally confuse everything, that's what makes the WHERE condition in the query?

    When I run the game "highlight text" it returns nothing

    If anyone knows why the WHERE clause is necessary?

    Thank you

    rodneyc8063 wrote:
    I don't understand why there are extra, extra quotes | and the "solomon_is_cool".

    Additional citations have nothing to do with dbms_xmlgen. In string literals Oracle must be in quotes by acronym. So what do you do if literal contains a quotation, for example O'Reily? The rule is, apostrophe inside the quoted string must be preceded by a second single quote. Thus, to produce the O string literal 'Reily, one must use 'O' Reily'. Now, back to dbms_xmlgen.get_xml. She waits for the SQL statement as a parameter. What SQL statement we want to produce? It would be:

    Select the text from user_views where view_name = "some-view-name."

    Right? Then, how the chain of the SQL statement above should look like? One way is to double single quotes:

    "Select the text from user_views where view_name =" some-view-name "'.

    But some-name-of-view is stored in the column of our query view_name. We have therefore concatenate the piecies which are:

    (1) text select lieral user_views where view_name = '
    (2) column view_name
    (3) literal '

    If we end up having:

    "Select the text from user_views where view_name ="' | view_name | ''''

    Now, you have replaced with solomon_is_cool view_name. This will not work because there is no solomon_is_cool column is user_views. What you probably wanted was:

    "Select the text from user_views where view_name ="solomon_is_cool"'.

    Then:

    dbms_xmlgen. GetXml ("select text from user_views where view_name ="solomon_is_cool"'") would look like to display user named solomon_is_cool text is tiny, which again could be a problem since the names, except between quotes, are stored in the data dictionary for uppercase. In any case, the counting of single quotes in string literals can be confusing. In the new versions of oracle introduced then Q-literals,

    dbms_xmlgen. GetXml ("select text from user_views where view_name =" "|") view_name | '''')

    could be replaced by more readable:

    dbms_xmlgen. GetXml (Q'[select text from user_views where view_name = ']' | view_name |) Q'[']')

    For example:

    SQL> select Q'[select text from user_views where view_name = ']' || view_name || Q'[']' from user_views where rownum < 3;
    
    Q'[SELECTTEXTFROMUSER_VIEWSWHEREVIEW_NAME=']'||VIEW_NAME||Q'[']'
    ------------------------------------------------------------------------------
    select text from user_views where view_name = 'EMP_VW'
    select text from user_views where view_name = 'REMOTE_DDL_VIEW_TEST'
    
    SQL> 
    

    SY.

  • Where the conditional, or PL/SQL block as a source for an interactive report?

    I have this situation: my app's main screen displays a list of documents. For now, there must be a quick way to 'security' integrated, so that administrators can see all documents, but only other users can see what documents, they created (connection of the creator is stored in the table of documents). In the future we will use probably VPD to enforce certain rules, but for the moment we need a quick solution.

    So I stored administrators in a separate table. Now I want the interactive Act report on the homepage as follows:
    -If an admin is connected, it must have this query: select field 1, 2, 3 area in documents
    -For all other users: select the field 1, 2, area 3 documents where creator =: app_user

    Is this possible in a single interactive report? I could do two reports with different queries, and make conditional depending on who is connected, but this gives me two interactive reports to maintain. Is it possible to use a PL/SQL block as a source for the report? I tried, but I get a syntax error. Is it possible to do where proviso on somehow?

    Hello

    Install the demo application to your workspace:
    Home > create an Application and select Demo Application.

    Check page 1 interactive report. This should give idea how.

    BR, Jari

  • Case where the Condition when Clause Condition use

    Hello

    How can I use case in the where condition and in when I need to use a condition, be clearly
    I need to get the following
    and (case WHEN :PROMT = 'Closed' then
     status_date >= trunc(sysdate))  end)
    When I run the present, I'm missing keyword error.

    How can I solve this?

    I think you can do it just like this:

    ...
    and ( :PROMPT != 'Closed' or status_date >= trunc(sysdate) )
    ...
    
  • How to use the NAME OF THE MONTH where the condition in the date column?

    Hi guys,.

    He comes to the table.
    SQL > desc ACMINUTESPDFTEST;
    Name Null? Type
    ----------------------------------------- -------- ----------------------------
    DATE OF ACDATE
    TYPE VARCHAR2 (10)
    Here, I tried 2 following queries, but I couldn't get the correct result

    Select the types, seqno, acdate of ACMINUTESPDFTEST, where acdate like to_date ('NOV', 'MY');
    or
    Select the types, seqno, acdate from ACMINUTESPDFTEST where acdate = to_date ('NOV', 'MY');

    (for both the query, the result is the same)
    TYPES ACDATE
    ---------- ------------
    ROSE NOVEMBER 1, 10

    but the table with the following data:
    TYPES ACDATE
    ---------- ------------
    ROSE NOVEMBER 14, 10
    WHITE NOVEMBER 15, 10
    ROSE NOVEMBER 1, 10


    Any suggestion why I could not get a good result.

    You can do this:

    where to_char(acdate,'MON') = 'NOV'
    
  • Where the conditional statement

    Hello

    I'm trying to reuse this page so that it can be used by different areas of my request. Currently, it displays all tables in a particular schema. I would like to reuse so that it could be used by another page that displays only the tables of a particular schema with a particular value set to 'Y' or 'n'. I have tried using if / case identified in SQL and PL/SQL, but none work. My PL/SQL statement gives the error:

    Query cannot be parsed, please check the syntax of your query. (ORA-06550: line 1, column 9: PLS-00103: encountered the symbol "" when expecting one of the following: begin function package pragma procedure subtype type use form current cursor symbol "" has been omitted.) Ora-06550: line 2, column 18: PLS-00103: encountered the symbol "" when expecting one of the following: begin function package pragma procedure subtype type use form current)
    -----
    The code is:
    declare 
    q varchar2(4000);
    
    begin 
    q:= 'select UNIQUE_ROWID, 
    OET_TBL_NM,
    OEP_ACTIVE_IN
    from #OWNER#.VIEW_EDIT_DB
    where oeu_id = :P21_DB and OET_TBL_OWN_NM = :P21_SCHEMA ';
    if :P21_Repl != null then
    q:=q|| ' and OEP_ACTIVE_IN = :P21_Repl ';
    end if;
    q:=q|| ' group by OET_TBL_NM, oeu_id, OET_TBL_OWN_NM, OEP_ACTIVE_IN, UNIQUE_ROWID
    order by OET_TBL_NM, OEP_ACTIVE_IN ';
    The key is the: P21_Repl comparison, which is where I try to reuse this page (: P21_Repl would take a 'Y' or the value "n" of a page or be null on the other). Is that what the problem/solution any idea? Thanks for any help.

    Mike

    Published by: Gerd June 22, 2009 00:34

    Hello

    What about

    SELECT "UNIQUE_ROWID"
         , "OET_TBL_NM"
         , "OEP_ACTIVE_IN"
    FROM "#OWNER#"."VIEW_EDIT_DB"
    WHERE     oeu_id = :p21_db
          AND oet_tbl_own_nm = :p21_schema
          AND NVL( :p21_repl, 'X' ) = DECODE( :p21_repl, NULL, 'X', oep_active_in )
    GROUP BY oet_tbl_nm
           , oeu_id
           , oet_tbl_own_nm
           , oep_active_in
           , unique_rowid
    ORDER BY oet_tbl_nm
           , oep_active_in
    

    See you soon

    Ben
    http://www.munkyben.WordPress.com
    Don't forget to mark the answers useful or correct ;)

  • When I right click on a page and select 'Copy' where the copy goes on my computer?

    I'm just trying to copy the page but I don't know where he's going. I guess that's what the copy function?

    See also http://en.wikipedia.org/wiki/Clipboard_%28computing%29

  • How to copy a selection without moving the entire image?

    Once I selected a part of an image, I try to use the move (with the ALT key) tool to copy the selection into another image.  But the movements of the whole picture and not only the selection.  What I am doing wrong?

    In fact, I found this one - move the selection into a new layer, then copy.

  • Changes to the selection without affecting the layer mask

    Hello

    I've hidden an image selection using the lasso tool. Added an adjustment layer (exhibition) and reduced the exposure. And then refined at the edge. Any fine. I add the layer to selection, and then click change the mask with the lasso to add and subtract the mask tool. I change the setting - raise or lower the exposure - but only the previous selection is affected - even if the framing box clearly shows the changes made to the selection.

    I need to create a new layer of setting each time so that it can work properly.

    Is - this usual? I thought that one could just edit the mask and then changes are applied automatically?

    Thank you

    Jez

    When you have a selection and create an adjustment layer, selection is enabled in the mask, so there is no longer a choice. By clicking on add a new selection to the selection at this point to this fact and does not add to the mask. You must use this selection and add fill it with white, black or a shade of gray that will then be used to request that the amount of the correction of the adjustment layer. If you want two different settings with different selections, then you will need to make two different adjustment layers.

  • Removal of the thumbnails selected without deleting the images in the slide show

    I thank in advance for your answers. I would like to create a slide show in the muse of adobe, but only show selected thumbnails to direct me to some images in the slide show. When I have a thumbnail then my slideshow extension deletes as well. I don't want that to happen. I have all the images in my wallet on a slide show, but I don't want the pictures for each image, just the first frame of each project. Is this possible in Muse? Thank you!

    Hello

    I have a workaround for the same thing.

    1. Please select the thumbnail you want to be invisible.

    2. double click on the tile so that the "thumbnail" is selected.

    3 drag and drop the image outside the slide show.

    4. place an invisible rectangle on the miniature container (this will eliminate the existence of the hyperlink so)

    Now try to get a preview of the page. Image will show in the slideshow, but thumbnail will not exist.

    You can also visit the pages idea to place a feature request to provide an option to make miniature hidden.

    Ideas for features in Adobe Muse

    Concerning

    Vivek

  • Dynamic load Message selection (Clause Where) in the application process!

    Problem with a choice of loading Message.

    I kept VO where the condition but I add WhereClause when loading the page. !!

    I guess this isn't my WhereClause given as it is not called when it has been initialized.

    Is that there is no way out?

    Published by: 942767 on 10 July 2012 23:25

    Hello

    Instead of putting the definition of VO, VO instance use and define the place where the duration clause.

    Kind regards
    GYAN

Maybe you are looking for