How can we retrieve all rows following a particular records in a table.

Hi all,
i've to fetch all records following a particular rcord in a table..
for ex. we have 4 rows :
col1 col2 col3
A A1 A2
B B1 B2
C C1 C2
D D1 D2
How can i retrieve rows following B record. plz. help me
Thx.

It depends what you mean by "following". Tables don't have an innate ordering. If you selected all the rows from this table they wouldn't necessarily turn up in that order.
All you can do is create a query ordering by one or more of the columns (in this case you appear to want lexical order) and then select on the basis that the column values exceed a set of values.
For example, with your data this happens to work:
select * from yourtable where col1 > 'B' order by co1;But I very much doubt that this is what you actually need to do, and it is VERY important that you grasp that tables do not have any innate ordering.

Similar Messages

  • How can I retrieve all row information from a database table.

    I have a jsp file which calls info from columns in a table. My question, is how can I edit it so that it retrieves all the rows?
    I tried using resultset SalesInfo.next() which only retrieves the last row value and resultset SalesInfo.first() which only retrieves the first row value.
    Here is my code
    public ResultSet SalesInfo;
    public void getSalesInfo()
              try
                   Statement stmt = db.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
                   SalesInfo = stmt.executeQuery("SELECT sales_id,cust_id,product_id, quantity from sales;");
                   SalesInfo.first();
                   setCartsales_id (SalesInfo.getString("sales_id"));
                   setCartcust_id (SalesInfo.getString("cust_id"));
                   setCartProduct_id(SalesInfo.getString("product_id"));
                   setCartquantity (SalesInfo.getString("quantity"));
              catch(SQLException e )
                   setCartsales_id(e.toString());
                   e.printStackTrace();
    Also I apologise for not having the proper code format as I had a problem with my keyboard.

         public class SalesDB{
        public static synchronized Vector getSalesDetail(Connection connection) throws SQLException{
            String query = "SELECT * from Sales;"
           Statement statement = connection.createStatement();
            ResultSet results = statement.executeQuery(query);
            Vector sale_details = new Vector();
            while(results.next() == true){
         SaleInfo saleInfo = new    SaleInfo(results.getString("sales_id"),results.getDouble("cust_id"),results.getString("product_id"));
                sale_details.add(saleInfo);
            results.close();
            statement.close();
            return sale_details;
    }

  • My iPhone was stolen last night and I'm trying to recover all my photos from that phone and get them on my mac laptop. The iCloud photo stream only imported 1,000 photos from my stolen phone. How can I retrieve all of my other photos?

    my iPhone was stolen last night and I'm trying to recover all my photos from that phone and get them on my mac laptop. The iCloud photo stream only imported 1,000 photos from my stolen phone. How can I retrieve all of my other photos?

    You have to reset the device to Factory Settings in order to restore it from an iCloud backup. You probably want to back it up as is before you do this.
    To do the reset after you have backed up the current device, go to Settings>Reset>Reset all Content & Settings. This will erase the device. If you are signed onto iCloud with Find My iPhone turned on, go to Settings>iCloud and scroll to the bottom to sign out of iCloud before you do the reset.
    Once you have reset your device, you will set it up like a new phone. When it asks if you want to restore it from an iCloud backup, select the backup you want to restore it from.
    Cheers,
    GB

  • I got the new iPhone5 back in Dec, I hooked it up to my computer for the 1st time this wk.  It deleted all new data added since Dec (notes,contacts,texts,pics, info in apps) and reverted back to all my old data.  How can I retrieve all the lost data??

    I got the new iPhone5 back in Dec, I hooked it up to my computer for the 1st time this wk.  It deleted all new data added since Dec (notes,contacts,texts,pics, info added to apps) and reverted back to all my old data (literally uploaded all of my old texts and 1400 old pics and deleted anything new).  How can I retrieve all the lost data?? Please help!!

    SkyDaughter29 wrote:
    My current situation: I have soooo many texts on my iphone and I haven't deleted many because I need the information contained in them for future reference and for legal purposes.  I would really like to find a means and way to save them other than on the phone itself. I've done searches for various apps yet I'm not finding what I think I would need.  It appears Apple does not sync the texts between the iphone and my MacBook Pro.
    Try the computer apps PhoneView (Mac) or TouchCopy (Mac & PC):
    http://www.ecamm.com/mac/phoneview/
    http://www.wideanglesoftware.com/touchcopy/index.php
    Best of luck.

  • How can I retrieve all texts from lost iPhone 6 plus left in lost mode?

    How can I retrieve all new texts going to my  lost iPhone 6 plus left in lost mode, through a browser or my wifi iPad ?

    Not through a browser.  If iMessage, set iPad to receive messages sent to your cell number:
    Settings > Messages > Send & Receive > You can be reached by iMessage at >
    SMS/MMS - no

  • How can I retrieve all my deleted history calls in iPhone 4S?

    How can I retrieve all my deleted history calls in iPhone 4S?

    Hi janet@felsted,
    To recover deleted data on an iPhone, users normally just perform an iPhone restore in iTunes or iCloud, restoring the device to how to was at the time of that backup.
    If you don't have a backup to recover from, or you wish to retrieve your deleted call history for legal reasons or to save and refer to later, you can use smartphone recovery software to recover all deleted calls contained on your iPhone's database.

  • I upgraded to Lion.  How can I retrieve all my former mailboxes?

    After the upgrade,  my inbox is intact with email back to April 2011,  when this computer was purchased.  I had emails dating back to 2008 in other mailboxes.  Now I can't find those emails or the mailboxes.  I thought I followed the instructions correctly.  My bookmarks are also gone from Safari.
    How can I retrieve my old emails, mailboxes and bookmarks?

    Pardon the question.  I hadn't noticed that Lion asked me to log in as a different user.  I logged out  and back in as the correct user and all is good in the world now.

  • HT1766 i have create new notes but it has disappeare all notes how can i retrieve all my notes

    I have created some new notes on my new iphone 5s but it has disappeared how can i retrieve it back

    Go to Settings- Notes.  What is showing as the default account?  If your email address, go to the desktop version of the email and check the Notes folder.  Yahoo and Gmail accounts will create Notes folders.  Of the setting is just the phone, there would be no way to retrieve them.  If the default is I cloud, contact Apple Support.

  • How can i retrieva all my backed up content onto my new phone plz

    how can i retreive all my backed up data onto my new phone plz

    Restoring to an iCloud backup has to be done in the initial setup process.  If you have any data on your phone now that is not in the backup that you want to save you'll need to do that first.  Then go to Settings>General>Reset and tap Erase All Content and Settings.  You will then go through the setup screens as you did when the phone was new. When given the option, choose Restore from iCloud Backup (see image below).  Be sure you are connected to wifi and your charger as this will take some time to finish.

  • I can't open my backed-up Iphoto Library on my new Mac with upgraded iLife. How can I retrieve all my pics??

    Having backed-up my old iMac using time machine, thinking to open up my iPhoto Library to retrieve all pics from Time Machine, but iPhoto doesn't let me open it. First a pop-up appears: "The photo library needs to be upgraded to work with this version of iPhoto. Your photo library will not be readable by previous versions of iPhoto after the upgrade. The upgrade process for very large libraries may take an hour or more to complete." When I click Upgrade another pop-up appears "You can’t open your current photo library using this version of iPhoto. You have made changes to your photo library using a newer version of iPhoto. Please quit and use the latest version of iPhoto." But I am using the latest version iLife 11. Is there a way to open up the library in a different way, so I can get my pics back???

    It sounds like the restored database is damaged.
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  

  • How can I retrieve all the CONTACTS that were deleted after  the sync of iphone to Mac?

    After I backed up my iphone onto my Mac computer I was asked If I wanted to save the photos from my phone. I said DELETE.   Then I discovered  my address and phone numbers (CONTACTS) went empty in the iphone.   How can I reverse my DELETE and get these Contacts back to the iphone?

    iCloud maintains a database of your contacts which it uses to keep all devices and computers connected to the same iCloud account in sync.  If you ever wonder whether you've lost contacts because they do not appear on a device or mac/pc, you should log into iCloud.com using a computer's browser and go to the Contacts page.  You should find your contacts there.  If there but they do not appear on your device, see below for instructions.  If they are not there, then for one reason or another, they have been deleted.  See below for options if this is the case.
    Getting contacts from iCloud to a device.
    Your device/computer needs to be connected to the proper account in iCloud and have contacts set for syncing.  Go to Settings>iCloud (for a device) or System Preferences>iCloud (for a mac - can't help you with a PC, but hopefully you'll know where to go).  Be sure iCloud is turn on and that you have the right account.  If you need to change the account, scroll to bottom of screen (device) and tap Delete Account.  Find a similar button on a mac.  This will not delete data from iCloud, it only disconnects the device/mac from the current account.  Then enter ID/password for the correct account.  Next, be sure Contacts is turned on.  [If it has been turned on, try turning off and then back on.  If still not working, disconnect from iCloud and connect again.]  You should get your contacts back.
    Contacts are gone from icloud.com.
    Then they have been deleted.  There are many reasons for this.  One possibility is that someone else is using the same iCloud account (family member, etc.) and they deleted contacts, thinking they did want them on THEIR device.  How to get them back?  Unfortunately, an iCloud backup does not include any of the sync databases, like contacts, notes, calendars, reminders, etc. because the data is already stored in these databases.  Your only hope for restoring the data is if you had that data on a computer (like a mac's Contacts, Calendars, etc.) and that data was backed up using whatever backup software you typically use (e.g. Time Machine on a mac).  Just restore the data files back to the computer.  Other than that, I'm afraid the data is gone.

  • [E2007] [EWSMA] [C#] [Windows]: How can I retrieve all mail sent via this Exchange server (during a time period)

    Hi there,
    I'm quite new to Exchange and I'm not sure how to do this.
    I've been looking at both push and pull mechanisms. 
    The query is conceptually simple. I can do it for one user, I think:
    var filter = new SearchFilter.IsGreaterThanOrEqualTo(ItemSchema.DateTimeSent, after);
    var folder = Folder.Bind(exchange, WellKnownFolderName.SentItems);
    var results = folder.FindItems(filter, new ItemView(1000));
    ....but I'm not sure how to it for all users.
    Many thanks!

    Hi,
    This may be another option for you...
    Is your Exchange hosted for you / Office365 or on premises?
    If it’s on premises and you have storage space you could use a Transport Agent (and specifically a Routing Agent).
    Using an agent you can take a copy of ALL email going in and out of a server (that's the whole email not just the headers or a log entry for it), then all you need to do is store it somewhere. I'd suggest just store it on file with an index (with date information
    and the path to the email on disk etc) in a SQL database. Then when you need your "emails in a date range" simply run a query against your SQL database to get the list of emails. You can always run a batch job every now and then to remove emails older than
    a certain date.
    If your Exchange is hosted (or you are not allowed to install software on the server) this won't be an option.
    Regards,
    Scott
    Scott Quinn | C# developer & messaging specialist (for hire). Contact me at http://au.linkedin.com/in/scottquinn

  • Scc question: how can I retrieve all files in 6.1?

    hello
    I have recently upgraded from LV5.1 to 6.1.. In 5.1
    it was possible to retrieve all files of a project
    with scc. When I try to do that in 6.1 (scc provider, select changed files, get latest version..) LV searches
    always in the local work directory for the vi's, but they don't exist, so I have to press "cancel" all the
    time.
    Is there an easier way to retrieve all files of a project at once???
    thanks

    NI support has sent me this VI, replace the original
    VI and it works..
    Attachments:
    Builtin_SCC_Retrieve_sub.vi ‏74 KB

  • How can I see ALL TRACKS by a particular artist?

    When I do a search in iTunes for a band that has a large catalogue (e.g. Pearl Jam or U2) I only get about 150 results. Now, for Pearl Jam I know there are more songs. How can I see a bands' ENTIRE catalogue of songs without having to click on each album individually? Also, if they have a song on a compilation, why isn't that listed in the bands' "All Albums" area? Thanks!

    Not all songs for a group may be for sale in the iTMS. They may hold out some songs/albums due to legal issues. Some groups have switched labels and not all labels are listing in the iTMS. AeroSmith is another example.
    MJ

  • How can i check that who is accessing paticular  record in a table

    Hi to All,
    some of users is complaint that they enable to access the paticular record in a table.Can any body do needfull to me to how to come out of this solution.
    Thanks and Regards
    Mohd Imran

    Hi Mohd,
    they enable to access the paticular record in a table.Check out virtual private databases (vpd). It allows specific access privileges to specific table rows. I have my notes here:
    http://www.dba-oracle.com/art_builder_vpd.htm

Maybe you are looking for

  • How to fragment a table in oracle?

    I am a bit confused about horizontal fragmentation in oracle, for example: I have two databases A and B I create a employee table in A database that has name, dept attributes Now I want to fragment this table, put all the rows where dept=science to t

  • Receiving data through TCP Socket

    Hi all, I am trying to receive some data through TCP Socket from the server using XMLSocketClass. Ther server is responding with some data. But I can't access this data in my application. Pls tell me the reasons for not working of handler private fun

  • Explain charging process change, please

    I've read thru threads about why the IPT G2 won't change with many adapters that charge the G1 and other iPods. The common explanation seems to be that earlier chargers / iPods used "Firewire 12v pins." I'm having trouble understanding this explanati

  • Oracle 9i, 10g 에서 트리거가 존재하는지 JDBC나 java api  에서 알아오는 방법이 있는지요?

    trigger 가 살아있는지 정상 동작하는지 알아오는 방법이 있나요? java 에서 점검할수있는 방법을 아시면 알려주십시요.

  • Premium Mail link broken for months - Please help

    I have been trying to upgrade to Premium Mail (as per many of the other posts I read on here) Every time I click on the Premium Mail link it tells me the page is broken. Thsi has been happening for a long while now. I can't find any way of doing it o