创建一个包含一些NULL值的新表

时间:2015-09-23 00:57:34

标签: sql postgresql join null

我有这些表

 id | tests    | results  
001 | testId_1 | 1  
001 | testId_2 | 1  
002 | testId_1 | 1  
003 | testId_2 | 1  
004 | testId_1 | 1  
004 | testId_2 | 1  

test_id | tests  
   1234 | testId_1  
   4565 | testId_2  

有没有办法将它们组合起来为NULL创建一个id值的新表格,而testId_x就像 id | tests | results 001 | testId_1 | 1 001 | testId_2 | 1 002 | testId_1 | 1 002 | testId_2 | NULL 003 | testId_1 | NULL 003 | testId_2 | 1 004 | testId_1 | 1 004 | testId_2 | 1 一样

    $(window).scroll(function () {
            var contentPosition = [];
            $('.examples').each(function () { //Get elements that have an id=
                contentPosition.push($(this).data('position')); //add id to array
            });

            var top = contentPosition.offset().top - $(document).scrollTop();
            if (top > 400) {
                console.log('COMBO BREAKER');
            }
        });

0 个答案:

没有答案