获取上一列并使用(Coloumn行索引)复制值,如果使用T-sql为NULL

时间:2015-04-28 07:41:23

标签: sql-server tsql

我明智地制定了财政年度财政年度数据,但是当新的财政年度开始时说进入2015-2016财政年度4月,剩下的行在那个特定的年份是NUll,我不想要那个,我需要前一年要显示的值而不是NULL

我的查询

    public static void CopyStream(Stream input, Stream output)
    {
        byte[] buffer = new byte[32768];
        int read;
        while ((read = input.Read(buffer, 0, buffer.Length)) > 0)
        {
            output.Write(buffer, 0, read);
        }
    }

我的T-sql

CopyStream

我的输出

Position

我的预期输出  要获得上一财政年度(即,2014 - 2015年5月的价值,2015 - 2016年5月的行数为空)

Position

提前致谢!

1 个答案:

答案 0 :(得分:1)

没有支点

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.*;  
import javax.swing.*;

public class Main extends JFrame {
    public Main() {

        //Creates Title Image 
        JLabel title = new JLabel(" ");
        ImageIcon tl = new ImageIcon("title.gif");
        title.setIcon(tl);

        //Creates Start Image
        final JButton start = new JButton("");
        ImageIcon st = new ImageIcon("start.gif");
        start.setIcon(st);

        //Creates Options Image
        JButton options = new JButton("");
        ImageIcon opt = new ImageIcon("options.gif");
        options.setIcon(opt);
        options.setBackground(Color.BLACK);

        //Creates label for level 0 background image
        JLabel background = new JLabel(" ");
        ImageIcon back = new ImageIcon("level0.gif");
        background.setIcon(back);

        //Creates a panel for level 0
        final JPanel p5 = new JPanel();
        p5.setLayout (new BorderLayout(1, 1));
        p5.add(background);

        //Create first frame for "Start" button
        final JPanel p1 = new JPanel();
        p1.setLayout(new GridLayout(1, 1));
        p1.add(start, BorderLayout.CENTER);

        //Create second panel for title label
        final JPanel p2 = new JPanel(new BorderLayout());
        p2.setLayout(new GridLayout(1, 3));
        p2.add(title, BorderLayout.WEST);

        //Create third panel for "Options" button
        final JPanel p3 = new JPanel(new BorderLayout());
        p3.setLayout(new GridLayout(1, 1));
        p3.add(options, BorderLayout.SOUTH);

        //Creates fourth panel to organize all other primary
        final JPanel p4 = new JPanel(new BorderLayout());
        p4.setLayout(new GridLayout(1, 3));
        p4.add(p1, BorderLayout.WEST);
        p4.add(p2, BorderLayout.CENTER);
        p4.add(p3, BorderLayout.EAST);

        //When button is clicked, it changes the level
        start.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if(start.isEnabled()) {
                    remove(p4);
                    add(p5, BorderLayout.CENTER);
                    invalidate();
                    validate();
                }
                else {
                    return;
                }
            }
        });

        //Adds fourth panel to frame
        add(p4, BorderLayout.CENTER);
    }

    public static void main(String args[]) {
        Main frame = new Main();

        //Finds screen size of monitor
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();

        //Creates the frame
        frame.setTitle("Cockadoodle Duty: Awakening");
        frame.setSize(screenSize);
        frame.setLocale(null); 
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
        String background = "#000000";
        frame.setBackground(Color.decode(background));
    }
}