Best way to search for a value in the table

Hello world

Need help to decide which application should be used in the following scenario.
Table  temp_a
( col_1 varchar2(20),
 status_flag varchar2(10)
);
col_1 is the primary key


I want to know if a given value is present in "col_1" of the table "temp_a.

So what query wud be faster:

1.
 select count (*)
from temp_a
where col_1 = v_col_1   -- using variable to check for value
and status_flag ='active' ;
2.
 
 select count (*)
from temp_a
where col_1 = v_col_1   -- using variable to check for value
and status_flag ='active' 
and rownum =1 ;
Here, I am not concerned about the number (*), I just need to check if the v_col_1 is present or not.

1. then please let me know, if both are one and the same. or one of them is faster over another.

2. also, is there a better way to check?

Thank you
Abhishek

The two approaches are the same, because col_1 is a primary key.
I think that there is a query then faster:

select count (*)
from temp_a
where col_1 = v_col_1
;

Max
[My Italian blog Oracle | http://oracleitalia.wordpress.com/2010/02/07/aggiornare-una-tabella-con-listruzione-merge/]

Tags: Database

Similar Questions

  • Confused about the best way to search for implicit keywords

    Hi all. I want to take full advantage of the LR3 Keywords, but I'm a bit stumped on how to search for implicit keywords. I've got animals > birds > Puffin and animals > birds > crows, etc.  What I want to do, but can't quite figure out is how to do is search for pictures of my birds.  (For example, to see all the photos of four star bird.)  But I find nothing (directly) to do.  What I can do, which is a bit indirect, to search for, say, the puffins (by typing "Puffin" in the search box in the keyword list Panel), which shows the Puffin and its keywords containing (birds and animals), form nested in the keyword list Panel. Of course, if I have the mouse on "Puffin" I can then click on the arrow to see all my pictures of puffins.  But I can also see all my pictures of birds (my goal) by mouse on 'the birds', get an arrow and click on it to see all my birds photos (Puffin, crows, etc.).  But that doesn't seem to work is just typing "birds" in the search field.  It indeed returns the implicit keyword of "the birds" in the list of keywords, but there is no arrow to click on to see all the photos of my birds.

    To summarize, if I want to see all the photos of my birds, I look for any type of bird, who then returned the bird nested under the 'birds' and 'animals' in the list of keywords. And I can then click on the arrow for the 'birds' containing key words to see pictures of my birds. But it is somewhat indirect.  I wish I could just search for "the birds" (an implicit keyword) get to all my pictures of birds.  Is it possible to do (directly)?  Thank you!!

    Hit birds in the search field of the library filter does not it you ask?

  • What is the best way to search for a Datagrid?

    I want to search the installer for a datagrid control.  I did a lot of research but could not come up with a solution of single column.  Can someone give some recommendations on how I can get all the data that is in the datagrid?

    Thank you.

    Dave

    DataProvider of the DataGrid control is always an instance of ICollectionView: ArrayCollection or XMLListColection collection.

    ICollectionView's filterFunction function that would make reference to a function with a signature of the individual:

    private function filter(item:Object): Boolean {}

    }

    When you have assinged this function to the collection of table and do a refresh() on this function to call for each element in the underlying dataProvider. The "item" is current object, the line if you want, in your dataProvider for which this method is called. Now that you have the complete object available you all it's available properties; make all checks you need and return true if you want to keep the line in the filtered list of false otherwise. That's all!

    Flex Builder Help has many examples of such FilterFunction, like google!

    Good luck!

    ATTA

  • Searches for a value in a table

    Hi guys' no lags,

    This should be a simple.

    I run an IF statement that needs to check the value of 5 in a pre-completed table.

    I find it difficult to find the right method of research in the table.

    If (myArray... == "0") {}

    do something

    }

    It's the... bit I'm stuck

    indexOf seems to come back just where the value is... but I already know where it is! I just want to know WHAT it is!

    There are also values that are exactly the same in other positions in the table. I have to focus more particularly on the value 5.

    Any help would be greatly appreciated!

    * past out *.

    myArray [4] == '0 '.

    The elements of an array starts with zero, so the fifth will be 4.

  • Search for Null values in the result of the query

    I queries a database for modules. I want to display the e-mail address of users, if there is one, if there is an email address, I want to draw the attention of the user of the present and offer them the chance to enter one. I thought I'd use an if statement, but can understand how cod if 'e-mail eq null. If the statement is looking for the text null instead of a null value

    VR;

    or

    --

    Azadi Saryev
    SABAI - Dee.com
    http://www.SABAI-Dee.com

  • Is there a way to search for a file in a site defined in Dreamweaver?

    I know that you can search for phrases in the code of a file, but what happens if I defined a great site in Dreamweaver with thousands of files it contains, and then I search for a file with the words 'contact' in there? Is there a way to do this in Dreamweaver or is there an extension that adds this functionality?

    The game, January 24, 2008 01:50:58 + 0000 (UTC), "MartinUCSD".
    wrote:

    > I know that you can search for expressions in a file code, but what happens if I
    > defined a great site in Dreamweaver with thousands of files it contains
    > and then I search for a file with the expression 'contact' in there? Is there a way
    > do cela in Dreamweaver or is there an extension that would add to this
    > feature?

    Of course

    Change | Find and replace

    put in the 'content' in the search - box select Search entire site and
    Click on search all the

    --

    ~ Malcolm N...
    ~

  • What is the best way to resize an image, but keep the height and width of the same original size or format?

    What is the best way to resize an image, but keep the height and width of the same original size or format?

    I tried to use the function of the size of the Image, but when I changed the size of the image, the width has not changed with it.

    Thanks for the tips!

    Hi Landon.Luu,

    You want to keep the relationship between the width and height to be the same?

    Click the constraint between width and height to keep the ratio intact.

    Kind regards

    Claes

  • What is the best way to import and export images from the 5 d Mark II?

    Hello

    I have just finished what I plan my first masterpiece of shooting film.  Shot on the Canon 5 d (1080 p, 24 fps), and the film looks amazing.  Now, I'm ready to start editing and now use creating lately, but I still have to figure out the proper conduct.  I want to know the best way to keep the resolution before I dive into this project.

    My questions:

    (1) what is the best way to start a new project and import the images without having to make while editing, in order to keep all the resolution and the originality of the source footage?

    (2) what is the best way / codec / format to export these images even once done editing to maintain than crisp 1080 p for which the 5 d is therefore counted?

    (3) what is the best way / codec / format for import and export / rendering between the first and after effects?  I speak especially of Visual effects and color correction.  I also a few sequences of 30 images per second that I intend to slow down in AE and then import into first.

    I know that it's wide enough, but as a solo Director I really need advice from someone.  Rarely, I finished my films with the same look crispy as images.  I need help of pipeline and really appreciate it!

    > used first lately

    A list of tutorial in the #3 http://forums.adobe.com/message/2276578 message

    1 - Please NOTE that the PPro CS6 screen may be a little different (I use CS5)

    For CS5 and later versions, the easy way to ensure that your video and your project

    See 2nd post for the photo of a NEW ELEMENT of process http://forums.adobe.com/thread/872666

    - and a FAQ on setting http://forums.adobe.com/message/3804341 sequence

    2 - BluRay... but I'm not sure if 1080 p is supported (I don't use of BluRay)

    1080 p http://forums.adobe.com/thread/995191 some work, some are not

    In addition, for upcoming posts, information FAQ http://forums.adobe.com/message/4200840

    In addition, read the metadata contained in the file http://forums.adobe.com/thread/1015001?tstart=0

    And finally, read Bill Hunt on http://forums.adobe.com/thread/919388?tstart=0 installation project

  • Best way to implement a standard provision in the application

    What is the best way to implement a standard provision in the entire application?  For example, I am converting a site HTML/ColdFusion to Flex and I have to keep the look of the current site in the new Flex application.  I need to a standard layout on every screen in the new application with a standard header, footer and the bar left navigation.  Do I need to add this code to each screen in the application, or can I just create the page layout file and challenging each screen?  Thank you!

    Take a look at some of the Flex samples.

    http://www.Adobe.com/devnet/flex/index.html?navID=samples

    You can download the source code for most of them, so you can see how it's done.

  • NPE for rows with null values in the table of the adv

    I created the table adv, 2 columns, equipped with two text fields. Initially the col2 is empty,
    say that the structure is as follows:
                  col1          col2
    Hdr         Question    Answer
    row1       abc           zxc
    row2       pdd           null (user doesnt enter anything)
    row3       zxc            lkj
    
    APPLYBUTTON
    When the user clicks on apply button I want to update these values in the table.

    I don't know how to do that, but that's what I'm trying to do. Please guide me the right way if its wrong.

    in LICS, I took the APPLYBUTTON action, got all lines of the object corresponding to the view, consulted with everyrow and I'm checking if there are values in the fields in the table, if the value zero, are simply print null. (we would not update on this line). . I could get o the part update, due to null pointer exception
    I get on the row line null pointer exception [1].getAttribute("Answer") for row2, it prints the value of row1 however.

    Here is the code I wrote:
    Set of rows from the rowset = (RowSet) vo.getRowSet ();
    Rank rank [] = vo.getAllRowsInRange ();
    System.out.println ("row.length" + row.length);
    for (int i = 0; i < row.length; i ++) {}
    String question = row.getAttribute("Question").toString ();
    String response = row [i].getAttribute("Answer").toString ();
    If (question! = null & &!("".)) Equals (question. Trim()))
    {
    System.out.println ("Question line" + i + "-" + question);
    }
    on the other
    {
    System.out.println ("Question line" + i + "is null");
    }

    If (response! = null & &!("".)) Equals (Answer.Trim ()))
    {
    System.out.println ("Response line" + i + "-" + response);
    }
    on the other
    {
    System.out.println ("Response line" + i + "is null");
    }

    Why the NPE survey code, I'm checking for null value and you want to print the value null in the logfile... I can not to getAttribute() on the null field, why can not just give me null in the variable I'm assigning to?

    You can guide me what approach to take, if it is not correct.
    I must examine DataDictionary and collect data there?
    Thanks in advance.

    Hello

    handle the exception of null on these two statements like this pointer

    String question = "";
    String response = "";

    Try
    {
    question = row.getAttribute("Question").toString ();
    }
    catch (NullPointerException e)
    {
    question = "";
    }

    Try
    {
    answer = row.getAttribute("Answer").toString ();
    }
    catch (NullPointerException e)
    {
    response = "";
    }

    Si ( !("". Equals (question. Trim()))
    {
    System.out.println ("Question line" + i + "-" + question);
    }
    on the other
    {
    System.out.println ("Question line" + i + "is null");
    }

    Si ( !("". Equals (Answer.Trim ()))
    {
    System.out.println ("Response line" + i + "-" + response);
    }
    on the other
    {
    System.out.println ("Response line" + i + "is null");
    }

    Thank you
    Gerard

  • What is the best way to consolidate e-mail messages in the e-mail program, before deleting?

    I have an iMac with a capacity to 1.11 - 679,49 GB available. With the software updated.

    Model name: I

    I have emails out of my different accounts in a "random" folder, but is not free up space. If I move an email in "Archives" and then it always remains in the e-mail account, apparently duplicate email in two places. "

    ERGO: the question is...

    What is the best way to consolidate e-mail messages in the e-mail program, before deleting?

    (I hope I've inserted which may be useful, but I'm not sure about that.)

    Thank you

    ilenefrombaltimore

    Archive messages or move them to some other local mailboxes or mailboxes on the server. Don't know what you are trying to do because it appears that you have 2/3 of your hard disk.

    Why do you think archiving emails in 2 places? Where are you trying to save space to?

  • How can I tell the mail client to search for new mail on the server?

    How can I tell the mail client to search for new mail on the server?

    Within the Mail app and display the Inbox you can pull down on the list of e-mail using your finger and you should see a small reel spinning gear. Which indicates that his check new email.

    You can also go into the settings of e-mail and calendars Contacts and view the settings there. Examine the settings of "search for new data. If the Push is enabled, then messages will be pushed to you if the email provider supports this feature. You can also set your accounts to use Fetch and set the frequency, he's going to go out and look for new e-mail messages.

  • I have a new time capsule airport. How to limit the search for who can use the time capsule backup process?

    I have a new time capsule airport. How to limit the search for who can use the time capsule backup process?

    Set a password to disk... disk tab in the utility... and just give to those you want to use the TC...

  • Windows cannot find C:\WINDOWS\system32\rundll.exe. Make sure you typed the name correstly and then try again. To search for a file check the Start button and then click search.

    I tried to launch my Spysweeper and found that is not there, then I re downloaded and I could not install it because it was already on my computer.  I went to the control panel to remove and got the message:

    Windows cannot find C:\WINDOWS\system32\rundll32.exe.  Make sure you typed the name correctly and then try again.  To search for a file, select the Start button and then check the search...

    What should I do?

    Hi gsrow,

    You can go there!

    Cannot find the Rundll32.exe file when you open the control panel:
    http://support.Microsoft.com/kb/812340

    Alternatively, copy the folder C:\Windows\System32\DllCache Rundll32.exe file to the System32 folder. Ramesh Srinivasan, Microsoft MVP [Windows Desktop Experience]

  • When you search for available updates on the update site, I receive the 0x800A0046 error.

    HELP 0X800A0046

    How to ask a question
    http://support.Microsoft.com/kb/555375 >

    It helps those answering questions if you provide:

    What is your full version of windows (32-bit or 64-bit) and service pack level. (Right-click on my computer and select properties: Windows version which is displayed on the general tab that results (for example, Windows XP Professional Service Pack 1;)) Windows Vista Edition SP2 family)?

    You use what browser (exact version).

    What application anti-virus or security suite is installed and your current subscription?

    A 3rd party firewall is used instead the native Windows Firewall?

    What other software products anti-malware are installed and running?

    What updates you trying to install? (Number of KB)

    Please do it in your next reply.

    Information you provide will help someone to provide you with a relevant solution

    What are the causes of error 0x800a0046

    0x800a0046.html http://www.updatexp.com/>

    -

    December 16, 2005 when looking for updates available on the update site, you receive the 0x800A0046 error.

    http://update.Microsoft.com/windowsupdate/v6/showarticle.aspx?articleid=20&LN=EN>

    - -- ---

    February 7, 2006 error message when you visit the Windows Update Web site or the Microsoft Update Web site:

    "0x800A0046".

    http://support.Microsoft.com/kb/910338/en-us>

    --

    July 2, 2010, you may receive an error message when you search for available updates on the Windows Update Web site or on the Microsoft Update Web site

    http://support.Microsoft.com/?kbid=883821>

    In most situations where the automatic updates and the system restore does not work, the usual causes are installed antivirus\security suite or malware.

    run a CHKDSK followed by a defrag after anti-malware analysis good or two.

    I recommend to download and install MalwareBytes' anti-malware (MBAM) and SUPERAntiSpyware (SAS).

    Do a FULL scan with MalwareBytes' and SUPERAntiSpyware.

    <>>

    http://www.Malwarebytes.org/MBAM.php

    Reset

    <>>

    http://www.SUPERAntiSpyware.com/

    Reset

    UTC/GMT is 02:23 on Saturday, February 25, 2012

Maybe you are looking for