Mapping of JTable Rows and columns and paint it to the JPanel

Hi,
I am using JTable and graphics object to draw the JTable on JPanel. But due to some lack of measurement I am not able to draw table cells correctly.
Apart from this on changing the fontSize I have to redraw it according to the requirement. But when the data size increases it draws absurdly.
I am using jTable.getCellRect() api to get the row width and height. Please help to redraw a JTable cell row and height on JPanel.
I am also attaching a sample code with this mail.
Thanks,
Ajay
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.*;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.table.*;
import java.util.*;
import java.awt.*;
public class SimpleTableDemo extends JPanel {
    private boolean DEBUG = false;
       private int spacing = 6;
       private Map columnSizes = new HashMap();
       String[] columnNames = {"First Name",
                                "Last Name",
                                "Sport",
                                "# of Years",
                                "Vegetarian"};
        Object[][] data = {
         {"Kathy", "Smith",
          "SnowboardingXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", new Integer(5), new Boolean(false)},
         {"John", "Doe",
          "Rowing", new Integer(3), new Boolean(true)},
         {"Sue", "Black",
          "Knitting", new Integer(2), new Boolean(false)},
         {"Jane", "White",
          "Speed reading", new Integer(20), new Boolean(true)},
         {"Joe", "Brown",
          "Pool", new Integer(10), new Boolean(false)}
        final JTable table = new JTable(data, columnNames);
          Panel1 panel;
    public SimpleTableDemo() {
        super(new GridLayout(3,0));
        table.setPreferredScrollableViewportSize(new Dimension(500, 70));
        //table.setFillsViewportHeight(true);
        if (DEBUG) {
            table.addMouseListener(new MouseAdapter() {
                public void mouseClicked(MouseEvent e) {
                    printDebugData(table);
        //Create the scroll pane and add the table to it.
        JScrollPane scrollPane = new JScrollPane(table);
        //Add the scroll pane to this panel.
        add(scrollPane);
        panel = new Panel1();
        Rectangle rect = table.getCellRect(0,0,true);
          panel.setX(table.getWidth());
          panel.setY(0);
        panel.setWidth(rect.width);
          panel.setHeight(rect.height);
        panel.setStr(table.getModel().getValueAt(0,0).toString());
          panel.setModel(table);
          add(panel);
        final JComboBox jNumberComboBoxSize = new JComboBox();
          jNumberComboBoxSize.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "11", "12", "14", "16", "18", "20", "24", "30", "36", "48", "72" }));
        jNumberComboBoxSize.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
               jNumberComboBoxSizeActionPerformed(jNumberComboBoxSize);
          JPanel panel2 = new JPanel();
          panel2.add(jNumberComboBoxSize);
          add(panel2);
          adjustColumns();
     private void jNumberComboBoxSizeActionPerformed(JComboBox jNumberComboBoxSize)
        int fontSize = Integer.parseInt(jNumberComboBoxSize.getSelectedItem().toString());
          table.setRowHeight(fontSize);
          table.setFont(new Font("Serif", Font.BOLD, fontSize));
          Rectangle rect = table.getCellRect(0,0,true);
          panel.setX(0);
          panel.setY(0);
       // panel.setWidth(rect.width);
          panel.setHeight(rect.height);
        panel.setStr(table.getModel().getValueAt(0,0).toString());
          panel.setModel(table);
          panel.repaint();
          table.revalidate();
    private void printDebugData(JTable table) {
        int numRows = table.getRowCount();
        int numCols = table.getColumnCount();
        javax.swing.table.TableModel model = table.getModel();
        System.out.println("Value of data: ");
        for (int i=0; i < numRows; i++) {
            System.out.print("    row " + i + ":");
            for (int j=0; j < numCols; j++) {
                System.out.print("  " + model.getValueAt(i, j));
            System.out.println();
        System.out.println("--------------------------");
      *  Adjust the widths of all the columns in the table
     public void adjustColumns()
          TableColumnModel tcm = table.getColumnModel();
          for (int i = 0; i < tcm.getColumnCount(); i++)
               adjustColumn(i);
      *  Adjust the width of the specified column in the table
     public void adjustColumn(final int column)
          TableColumn tableColumn = table.getColumnModel().getColumn(column);
          if (! tableColumn.getResizable()) return;
          int columnHeaderWidth = getColumnHeaderWidth( column );
          int columnDataWidth   = getColumnDataWidth( column );
          int preferredWidth    = Math.max(columnHeaderWidth, columnDataWidth);
        panel.setWidth(preferredWidth);
          updateTableColumn(column, preferredWidth);
      *  Calculated the width based on the column name
     private int getColumnHeaderWidth(int column)
          TableColumn tableColumn = table.getColumnModel().getColumn(column);
          Object value = tableColumn.getHeaderValue();
          TableCellRenderer renderer = tableColumn.getHeaderRenderer();
          if (renderer == null)
               renderer = table.getTableHeader().getDefaultRenderer();
          Component c = renderer.getTableCellRendererComponent(table, value, false, false, -1, column);
          return c.getPreferredSize().width;
      *  Calculate the width based on the widest cell renderer for the
      *  given column.
     private int getColumnDataWidth(int column)
          int preferredWidth = 0;
          int maxWidth = table.getColumnModel().getColumn(column).getMaxWidth();
          for (int row = 0; row < table.getRowCount(); row++)
              preferredWidth = Math.max(preferredWidth, getCellDataWidth(row, column));
               //  We've exceeded the maximum width, no need to check other rows
               if (preferredWidth >= maxWidth)
                   break;
          return preferredWidth;
      *  Get the preferred width for the specified cell
     private int getCellDataWidth(int row, int column)
          //  Inovke the renderer for the cell to calculate the preferred width
          TableCellRenderer cellRenderer = table.getCellRenderer(row, column);
          Component c = table.prepareRenderer(cellRenderer, row, column);
          int width = c.getPreferredSize().width + table.getIntercellSpacing().width;
          return width;
      *  Update the TableColumn with the newly calculated width
     private void updateTableColumn(int column, int width)
          final TableColumn tableColumn = table.getColumnModel().getColumn(column);
          if (! tableColumn.getResizable()) return;
          width += spacing;
          //  Don't shrink the column width
          width = Math.max(width, tableColumn.getPreferredWidth());
          columnSizes.put(tableColumn, new Integer(tableColumn.getWidth()));
          table.getTableHeader().setResizingColumn(tableColumn);
          tableColumn.setWidth(width);
     * Create the GUI and show it.  For thread safety,
     * this method should be invoked from the
     * event-dispatching thread.
    private static void createAndShowGUI() {
        //Create and set up the window.
        JFrame frame = new JFrame("SimpleTableDemo");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        //Create and set up the content pane.
        SimpleTableDemo newContentPane = new SimpleTableDemo();
        newContentPane.setOpaque(true); //content panes must be opaque
        frame.setContentPane(newContentPane);
        //Display the window.
        frame.pack();
        frame.setVisible(true);
    public static void main(String[] args) {
        //Schedule a job for the event-dispatching thread:
        //creating and showing this application's GUI.
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGUI();
class Panel1 extends JPanel
    int x;
     int y;
     int width;
     int height;
     String str;
     JTable model;
    public void setModel(JTable model)
       this.model = model;
     public void setX(int x)
          this.x = x;
    public void setY(int y)
          this.y = y;
     public void setWidth(int w)
          this.width = w;
    public void setHeight(int h)
          this.height = h;
     public void setStr(String s)
          this.str = s;
    public void paint(Graphics g)
         super.paint(g);
          int initX= 0;
          for(int row=0;row < 5; ++row)
               initX = x;
               for (int col=0;col < 5;++col)
                    g.drawRect(x,y,width,height);
                    g.drawString(model.getModel().getValueAt(row,col).toString(),x + 10,y + 10);
                    x = x + width;
            x = initX;
               y = y + height;
};

an easy way would be to use setSize()

Similar Messages

  • How to find accurate number of Rows, and size of all the tables of a Schema

    HI,
    How to find the accurate number of Rows, and size of all the tables of a Schema ????
    Thanks.

    SELECT t.table_name AS "Table Name",
    t.num_rows AS "Rows",
    t.avg_row_len AS "Avg Row Len",
    Trunc((t.blocks * p.value)/1024) AS "Size KB",
    t.last_analyzed AS "Last Analyzed"
    FROM dba_tables t,
    v$parameter p
    WHERE t.owner = Decode(Upper('&1'), 'ALL', t.owner, Upper('&1'))
    AND p.name = 'db_block_size'
    ORDER by 4 desc nulls last;
    ## Gather schema stats
    begin
    dbms_stats.gather_schema_stats(ownname=>'SYSLOG');
    end;
    ## Gather a particular table stats of a schema
    begin
    DBMS_STATS.gather_table_stats(ownname=>'syslog',tabname=>'logs');
    end;
    http://www.oradev.com/create_statistics.jsp
    Hope this will work.
    Regards
    Asif Kabir
    -- Mark the answer as correct/helpful

  • How do I create a 1d array that takes a single calculation and insert the result into the first row and then the next calculation the next time the loop passes that point and puts the results in thsecond row and so on until the loop is exited.

    The attached file is work inprogress, with some dummy data sp that I can test it out without having to connect to equipment.
    The second tab is the one that I am having the problem with. the output array from the replace element appears to be starting at the index position of 1 rather than 0 but that is ok it is still show that the new data is placed in incrementing element locations. However the main array that I am trying to build that is suppose to take each new calculation and place it in the next index(row) does not ap
    pear to be working or at least I am not getting any indication on the inidcator.
    Basically what I am attempting to do is is gather some pulses from adevice for a minute, place the results for a calculation, so that it displays then do the same again the next minute, but put these result in the next row and so on until the specifiied time has expired and the loop exits. I need to have all results displayed and keep building the array(display until, the end of the test)Eventually I will have to include a min max section that displays the min and max values calculated, but that should be easy with the min max function.Actually I thought this should have been easy but, I gues I can not see the forest through the trees. Can any one help to slear this up for me.
    Attachments:
    regulation_tester_7_loops.vi ‏244 KB

    I didn't really have time to dig in and understand your program in depth,
    but I have a few tips for you that might things a bit easier:
    - You use local variables excessively which really complicates things. Try
    not to use them and it will make your life easier.
    - If you flowchart the design (very similar to a dataflow diagram, keep in
    mind!) you want to gather data, calculate a value from that data, store the
    calculation in an array, and loop while the time is in a certain range. So
    theres really not much need for a sequence as long as you get rid of the
    local variables (sequences also complicate things)
    - You loop again if timepassed+1 is still less than some constant. Rather
    than messing with locals it seems so much easier to use a shiftregister (if
    absolutely necessary) or in this case base it upon the number of iterations
    of the loop. In this case it looks like "time passed" is the same thing as
    the number of loop iterations, but I didn't check closely. There's an i
    terminal in your whileloop to read for the number of iterations.
    - After having simplified your design by eliminating unnecessary sequence
    and local variables, you should be able to draw out the labview diagram.
    Don't try to use the "insert into array" vis since theres no need. Each
    iteration of your loop calculates a number which goes into the next position
    of the array right? Pass your result outside the loop, and enable indexing
    on the terminal so Labview automatically generates the array for you. If
    your calculation is a function of previous data, then use a shift register
    to keep previous values around.
    I wish you luck. Post again if you have any questions. Without a more
    detailed understanding of your task at hand it's kind of hard to post actual
    code suggestions for you.
    -joey
    "nelsons" wrote in message
    news:[email protected]...
    > how do I create a 1d array that takes a single calculation and insert
    > the result into the first row and then the next calculation the next
    > time the loop passes that point and puts the results in thsecond row
    > and so on until the loop is exited.
    >
    > The attached file is work inprogress, with some dummy data sp that I
    > can test it out without having to connect to equipment.
    > The second tab is the one that I am having the problem with. the
    > output array from the replace element appears to be starting at the
    > index position of 1 rather than 0 but that is ok it is still show that
    > the new data is placed in incrementing element locations. However the
    > main array that I am trying to build that is suppose to take each new
    > calculation and place it in the next index(row) does not appear to be
    > working or at least I am not getting any indication on the inidcator.
    >
    > Basically what I am attempting to do is is gather some pulses from
    > adevice for a minute, place the results for a calculation, so that it
    > displays then do the same again the next minute, but put these result
    > in the next row and so on until the specifiied time has expired and
    > the loop exits. I need to have all results displayed and keep building
    > the array(display until, the end of the test)Eventually I will have to
    > include a min max section that displays the min and max values
    > calculated, but that should be easy with the min max function.Actually
    > I thought this should have been easy but, I gues I can not see the
    > forest through the trees. Can any one help to slear this up for me.

  • When downloading an application from the App Store requires a map of all. And I would like the function is deactivated

    When downloading an application from the App Store requires a map of all. And I would like the function is deactivated

    Please post in your native language. This makes no sense.

  • Retreiving Point location with JTable row and column

    If I have the row and column in a JTable (in a JPanel), how do I get the Point location offset from the location Point of the JTable or JPanel ?

    I think that this may do it.
    Point objPoint = new Point( objTable_.getLocation() );
    int intRow = objTable_.getSelectedRow();
    int intColumn = objTable_.getSelectedColumn();
    int intColumnWidth = objTable_.getColumnModel().getColumn( intColumn ).getWidth();
    int intColumnMargin = objTable_.getColumnModel().getColumnMargin();
    int x = (int) objPoint.getX() + ( (intColumn+1) * intColumnWidth) );
    // perhaps * (intColumnWidth + intColumnMargin)
    int y = (int) objPoint.getY() + ( (intRow+1) * objTable_.getRowHeight());
    // perhaps * (objTable_.getRowHeight() + objTable_.getRowMargin())

  • JTable  - Rows and columns

    I have created a JTable that displays the results from a query. My question is how can I get the JTable to display only a given number of rows and columns and have a scrollbar to see the rest of the cells?
    Thank you

    an easy way would be to use setSize()

  • Sort jTable rows by column as Integer value

    Hi all,
    I have problem with sort jTable rows. I have some columns and in first are integer data. jTable sort that as String value..1,10,11,12....2,21, ...
    How can I do that?
    Thanks

    In the future, please post Swing questions to the Swing forum: http://forum.java.sun.com/forum.jspa?forumID=57
    What does the TableModel's getColumnClass method return for that column?

  • How to find out How many rows and coloumn exists in the Excel sheet

    hai gurus,
                 present iam uploading data from presentation server to application server.  when i use gui_upload the data is coming non-readable format.
    so i used alsm_excel_to_int fm for that . but the problem is user can give any type of excel so... i need to know how many rows and coloumn s existed in that Excel
    so is there any possiblity to get those values(Total rows and total coloumns).
    plz help me..
    if any one answered , appreciate with reward points,
    thanks&regards,
    Venu.T

    see you have to come into an agreement with other system before starting development..
    Please dont do unnecessary coding for impractical things ..you may solve this but this is not good way of working in eRP packages..
    Al least u can get final list of all Columns and which can be blank or non blank like this
    then u can  do coding for this scenerio
    regards...
    Message was edited by:
            Madan Gopal Sharma

  • Problems copying a row and pasting it in the following row

    Hi all,
    In a Numbers table I have 400 rows with data separated each one by a blank row
    row 2 has data
    row 3 is blank
    row 4 has data
    row 5 is blank ... and so on.
    I have prepared a small script to copy row 2 into row 3, row 4 into row 5,... as follows:
    set dName to "Conta"
    set sName to "Movis"
    set tName to "Pruebas"
    set row_ini to 2
    tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
    set selection range to row row_ini
    repeat
    if value of first cell of selection range = 0 then
    exit repeat
    else
    tell application "System Events"
    keystroke "c" using {command down}
    keystroke return
    keystroke "v" using {command down}
    end tell
    tell first cell of the selection range to set rowNum to address of its row
    set selection range to row (rowNum + 1)
    end if
    end repeat
    end tell
    The idea is:
    1 select the initial row (in this case row 2)
    2 check if the value of first cell of the row is cero, then exit the repeat loop
    3 else
    4 copy the entire row, move down a row and paste.
    5 move to the next row
    6 repeat
    The first time I run the script it worked until the row 124 and stopped. I tried again changing the inicial row and it worked only for 7 rows. The third time it erased all the cells with data. I've tried closing both the table and the script but the problems persists: in this case it stops after replacing 5 rows.
    Where am I wrong?
    Thank you in advance
    Ratz

    KOENIG Yvan wrote:
    There is not such a book.
    There is just on short chapter dedicated to iWork in :
    Hanaan Rosenthal & Hamish Sanderson, Learn AppleScript: The Comprehensive
    Guide to Scripting and Automation on Mac OS X, Third Edition, Apress (2010);
    ISBN 978-1-4302-2361-0
    You may find useful infos in my idisk :
    <http://public.me.com/koenigyvan>
    Scan the contents of the folder :
    For_iWork:iWork '09:for_Numbers09.
    I guess the problem is for using the tell application block without telling the process Numbers.
    No, I had to change a lot of things.
    the name of the document was wrong (at least on my machine on which I always use the name extension.
    set selection range … was wrong.
    Yvan KOENIG (VALLAURIS, France) dimanche 20 février 2011 23:02:35
    Thank you.
    Visiting your idisk I realise how much work I must do to become a decent scripter!
    The book you mention looks interesting. I'm going to include it in my bookcase (and read it, of course).
    Ratz

  • How to find out How many rows and coloumn exists in the Excel sheet at run

    hai gurus,
             iam uploading excel to application sever,. when i used gui_upload the data is non-readable. so.. i used alsm_excel_to_int fm .but the problem is user can upload any type of Excel to Application so i need to know the total no of rows and coloum at runtime .is there any possiblity to find out those values.
    Plz help me.
    if any one answered , rewards points,
    Thanks &Regards,
    Venu.T

    Hi kiran,
    i u case better to upload the data first to application server than u can run the bdc program that will helps u
    try these T-code for uploading data from prsentation server to application
    CG3Y and CG3Z this will helps.
    reward is usefull.
    thanks.
    patil.

  • Row Curr/No Rows and ADF Table- Found the issue but no solution Attn: Frank

    I have an ADF table that has ten rows of data. I have set it to show 5. When I try to go to the next page by clicking "Next" and do a "Show All" I get Row Currency error and "No Rows." However, if I set the ADF Tbale to shopw 10 rows, it shows them all. Any ideas?
    I have been looking at it for a week.

    Error
    JBO-35007: Row currency has changed since the user interface was rendered. The expected row key was oracle.jbo.Key[]
    On the jspx, I have:
    ***** No rows yet. ******************
    In the message log, I have
    oracle.adf.controller.faces.lifecycle.FacesPageLifecycle addMessage
    WARNING: JBO-35007: Row currency has changed since the user interface was rendered. The expected row key was oracle.jbo.Key[]
    Oh, by the way, I see the message below, before any error happened
    Jun 11, 2008 12:29:38 PM oracle.adfinternal.view.faces.taglib.ValidatorTag createValidator
    SEVERE: attribute 'validatorId' is missing
    Jun 11, 2008 12:29:38 PM oracle.adfinternal.view.faces.taglib.ValidatorTag doStartTag
    WARNING: could not create validator for validatorId:null and binding:#{bindings.MenuId.validator}
    Jun 11, 2008 12:29:42 PM

  • How to select rows or columns of tables without using the mouse?

    2nd post ever! Yeah! \m/
    In Excel, I can select entire rows or columns of data WITHIN TABLES--i.e., not selecting entire sheet rows or columns--by going to any cell on the perimeter of the table, holding down shift+ctrl, and clicking a direction arrow. So for example, if I have a table in columns D-G and rows 1-5, I can highlight row 4 by going to the first or last cell of that row, holding down the shift+ctrl, and hitting the appropriate direction arrow. You might think this is superfluous given that you can use the mouse to select cells. But that becomes cumbersome with large tables, and this method can be more efficient even with small tables.
    Similarly, it's often useful to navigate tables, particularly large ones, by moving from any cell within the table to the end or beginning of that row or column by holding down ctrl and hitting the appropriate arrow key. In Excel, this ctrl+arrow key method also allows you to skip blank cells, which is another very useful navigational feature.
    I tried numerous combos involving shift, ctrl, command, alt/option and the arrow keys. Haven't found a way to do any of this yet.
    Anyone?

    Hi Josh,
    Numbers is organized differently than Excel, and the navigation tools are different too. Many of us miss our particular favorites from spreadsheets past, but this is Numbers, not a clone. The biggest adjustment is to go from huge monolithic sheet-tables containing virtual sub-tables to a simple blank sheet with small tables, sometimes many per sheet. Navigating is no big deal in these small tables and neither is getting from one small table to another, using the Sheets pane.
    Selecting a particular Table is as easy as clicking on the table's name in the Sheets pane. Selecting a particular row, or column, or ranges of rows or columns is done by clicking on the table's row and column labels, left side and top side once a cell is selected in the table.
    Numbers is weak at handling large Tables and documents that are large overall. We know this and many of us still prefer it to the alternative when the tool fits the task.
    Jerry

  • Remove JTable row and column in one event

    Hello,
    I 've using matrix table in one application.
    i need to remove both column and row in single event.
    For this i construct
    JTable(data[][], header[]);
    because dynamically increase data's and header's
    What can i do for this?

    Create a method that does:
    DefaultTableModel model = (DefaultTableModel)table.getModel();
    model.removeRow(...)
    model.setRowCount(...)
    Read the DefaultTableModel API for more information.

  • Sum of first 50% of rows and remaining 50% of the rows seperately

    Hi
    I have a table
    create table eresults
    (student_name varchar2(20),
    section_name varchar2(4),
    exam_id NUMBER (4))
    marks NUMBER (3))
    Begin
    insert into eresults values ('MOEED', 'A', 1, 20);
    insert into eresults values ('SARAH', 'A', 1, 30);
    insert into eresults values ('SAM', 'A', 1, 24);
    insert into eresults values ('MOEED', 'A', 2, 65);
    insert into eresults values ('SARAH', 'A', 2, 100);
    insert into eresults values ('SAM', 'A', 2, 4);
    insert into eresults values ('MOEED', 'A', 3, 34);
    insert into eresults values ('SARAH', 'A', 3, 10);
    insert into eresults values ('SAM', 'A', 3, 40);
    insert into eresults values ('SARAH', 'A', 4, 33);
    insert into eresults values ('SAM', 'A', 4, 99);
    end;
    / I want to take a sum of marks, group by student name, for each student in such a way that their first 50% of exams (order by exam id) marks sum is shown seperately in a column and the remaining 50% of the exams summed marks are shown in another column. For students appearing in odd number of exams, like 1,3,5,7 etc - I want the calculation in such a way that first 50% sum will show marks obtained like this: For example a student appeared in 3 exams, so 50% exams shall be 1.5 exams - so the sum of first 50% should be his first exam marks + the 50% of the marks obtained by him in the 2nd or middle or tie breaker exam. And the remaining 50% exam marsk shall be: the 50% of the marks obtain in the 2nd exam + the marks obtained in the 3rd exam. Based on above data, Moeed appeared in 3 exams, and his marks were 20, 65 and 34. So his first 50% marks shall be 20 + 65/2 = 32.5 => 52.5 total marks. And his 2nd 50% marks shall be 65/2 = 32.5 + 34 = 66.5 total marks
    I hope I've been able to clear my requiment.
    I will appreciate the shortest and simplest possible query to achieve since I've a large data and then I also need to take average of first 50% sum marks divided by 50% of the exams.
    Thanks in advance.
    regards
    Hamza
    Edited by: Hamza on May 25, 2011 12:46 AM

    TRy this
    /* Formatted on 2011/05/24 16:23 (Formatter Plus v4.8.8) */
    SELECT student_name, section_name, marks,
           SUM (marks) OVER (PARTITION BY student_name, section_name) sum_marks,
           CASE
              WHEN exam_id = 1
                 THEN   marks
                      +   LEAD (marks, 1, 0) OVER (PARTITION BY student_name, section_name ORDER BY exam_id)
                        / 2
              WHEN exam_id = max_id_exam
                 THEN   marks
                      +   LAG (marks, 1, 0) OVER (PARTITION BY student_name, section_name ORDER BY exam_id)
                        / 2
              ELSE marks
           END res
      FROM (SELECT student_name, section_name, exam_id, marks,
                   MAX (exam_id) OVER (PARTITION BY student_name, section_name)
                                                                      max_id_exam
              FROM eresults)
    STUDENT_NAME         SECT      MARKS  SUM_MARKS        RES
    MOEED                A            20        119       52.5
    MOEED                A            65        119         65
    MOEED                A            34        119       66.5
    SAM                  A            24        167         26
    SAM                  A             4        167          4
    SAM                  A            40        167         40
    SAM                  A            99        167        119
    SARAH                A            30        173         80
    SARAH                A           100        173        100
    SARAH                A            10        173         10
    SARAH                A            33        173         38
    11 rows selected.Edited by: Salim Chelabi on 2011-05-24 13:23

  • Have light room 5 .....maps only show yellow and red photo tags the map it self struggles to load and in most cases wont load at all

    i have light room 5
    tried loading map but only get the yellow and orange/red photo tags click on the tags the photos show but the map it self will not load

    There's no limit that I know of, I can certainly place all of my photos on my map (and I have about 18000 geotagged photos), but the speed of your CPU will certainly make a difference, maybe memory too (how much memory do you have?)
    as far as I’m aware there are no filters turned
    Did you actually check? Or are you saying you THINK there are no filters turned on? (these are not the same thing)

Maybe you are looking for

  • PDF files only show the Acrobat icon

    Hi, I'm new and just read all of the PDF discussions about Safari. I have a similar problem. Each time I open a PDF page all I get is the Acrobat icon in the middle of the screen. When I try to save as to my desktop, it's always corrupted. I can't re

  • Can't open Compressor

    When i am in fcp I go to export to compressor and it won't open it just asks to close, retry or report. I deleted the compressor preferences and that didn't help. I have the latest version 2.3 What can I do?

  • Usage of FOR ALL ENTRIES in SELECT query

    Hi All, While writing SELECT query using FOR ALL ENTRIES, in the WHERE condition can we use IN operator on a range table? Will this work out. Thanks, Anil Kumar

  • Possibility to attach documents in TEM?

    Hi all, I've accidentally posted this as a blog post already, but I guess it more belongs into the discussion section: We have an old Training and Event Management solution in use and I received the question whether it is possible to link a scanned f

  • Ready to move my service after over 8 years

    It was time for my upgrade so I decided to go with the LG Vortex because they were free online. Well after I ordered and recieved the phones I found that I had ordered two new lines instead of upgrading my lines. I had to drive 1 1/2 hours to a corpo