我从3个表(日期和数量)检索数据,一些数据可能重叠但不确定哪些表.例如,某些天可能在表t1和t2中重叠但在t3或t2和t3中不重叠但在t1或t1和t3中不重叠但在t2中不重叠
如果我执行完全连接,我最终会得到很多空值和三个不同的日期列.
如何获取要格式化的数据:
date,qty1, qty2, gty3哪里[date]将包含3个表的所有日期?零将替换所有空值
07/02/2012 || 2 || 0 || 7
CREATE TABLE t1 (
[date] [nvarchar](10)
,qtyt1 [int]
)
CREATE TABLE t2 (
[date] [nvarchar](10)
,qtyt2 [int]
)
CREATE TABLE t3 (
[date] [nvarchar](10)
,qtyt3 [int]
)
insert into t1 values ('05/02/2012', 2)
insert into t1 values ('07/02/2012', 3)
insert into t2 values ('06/02/2012', 4)
insert into t2 values ('08/02/2012', 5)
insert into t3 values ('07/02/2012', 7)
insert into t3 values ('08/02/2012', 11)
select …Run Code Online (Sandbox Code Playgroud) <?xml version="1.0"?>
-<bookstore>
<book >
<title>aaaa</title>
-<author >
<first-name>firts</first-name>
<last-name>last</last-name>
</author>
<price>8.23</price>
<otherbooks>
<book >
<title>bbb</title>
<price>18.23</price>
</book>
<book >
<title>ccc</title>
<price>11.22</price>
</book>
</otherbooks>
</book>
</bookstore>
Run Code Online (Sandbox Code Playgroud)
我从xml文件中选择了所有书籍.如何使用XPath为每本书选择标题,作者(名字和姓氏)和价格?
xPathDoc = new XPathDocument(filePath);
xPathNavigator = xPathDoc.CreateNavigator();
XPathNodeIterator xPathIterator = xPathNavigator.Select("/bookstore//book");
foreach (XPathNavigator book in xPathIterator)
{
??
}
Run Code Online (Sandbox Code Playgroud) 我正在使用ui.bootstrap collapse指令来显示下拉菜单.我想在用户点击div之外时自动折叠它.
当用户点击Filter按钮时,我使用以下方法设置焦点:
.directive('setFocus', function () {
return {
restrict: 'A',
scope: {
focusValue: "=setFocus"
},
link: function ($scope, $element, attrs) {
$scope.$watch("focusValue", function (currentValue, previousValue) {
if (currentValue === true && !previousValue) {
$element[0].focus();
console.log('set focus from setFocus directive');
} else if (currentValue === false && previousValue) {
$element[0].blur();
console.log('blurr from setFocus directive');
}
})
}
}
});
Run Code Online (Sandbox Code Playgroud)
HTML
<div collapse="isDropDownCollapsed" class='div2' align-element-right='el1' set-focus='!isDropDownCollapsed' ng-blur="toggleMenu()">
Run Code Online (Sandbox Code Playgroud)
调节器
app.controller('testCtrl', function ($scope) {
$scope.isDropDownCollapsed = true;
$scope.toggleMenu = function () {
$scope.isDropDownCollapsed …Run Code Online (Sandbox Code Playgroud)