我有一个问题..所需要的是创建一个触发器,以检查销毁日期(dateEmpr)是否小于退货日期(dateRetEff),将其增加至退货日期10天。返回
表结构
CREATE TABLE emprunter(
numLivre VARCHAR(5),
dateEmpr DATE,
numInsc VARCHAR(5),
dateRetEff DATE
);
这是我的代码..它告诉我这是错误的
CREATE TRIGGER verifier_date
BEFORE INSERT ON emprunter
FOR EACH ROW
BEGIN
if((SELECT DATEDIFF(NEW.dateRetEff, NEW.dateEmpr) from emprunter ) <0) then
dateEmpr = DATE_ADD(OLD.dateEmpr, INTERVAL 10 DAY);
end if;
END;
答案 0 :(得分:0)
function Parent(props){
/*I wish to have a list of all the components of type <Child>
within props.children before making it to the return function.
I would need to iterate over all props.children and their
children as well, and check if its a <Child> component.
I would weed out all other components/elements to only have a
list of all <Child> components
*/
return(
{props.children}
)
}
function Child(props){
return(
{props.children}
)
}
function App(){
return(
<Parent>
<div>Just a div, would be weeded out</div>
<Child>special component that Im looking for</Child>
<div> //this div would be weeded out,
//but the <Child> component in it must be found!
<Child>special component that Im looking for</Child>
</div>
</Parent>
)
}