过滤条件(Filter where on condition)
我有这张桌子
User | SecretId | Status warheat1990 | NULL | REV warheat1990 | NULL | COM warheat1990 | 1 | REV warheat1990 | 1 | COM
我想过滤掉数据(Status = REV和SecretId IS NOT NULL合并),所以最终结果将是
User | SecretId | Status warheat1990 | NULL | REV warheat1990 | NULL | COM warheat1990 | 1 | COM
我的查询
SELECT * FROM TABLE WHERE User = 'warheat1990' AND (Status <> 'REV' AND SecretId IS NULL)
但它不起作用,因为它只给我这条行。
User | SecretId | Status warheat1990 | NULL | COM
那么如何使用Status = REV排除数据,但仅当SecretId不为NULL时才排除数据
我觉得愚蠢,我无法弄清楚这个简单的案例。 任何帮助将不胜感激。
I have this table
User | SecretId | Status warheat1990 | NULL | REV warheat1990 | NULL | COM warheat1990 | 1 | REV warheat1990 | 1 | COM
I want to filter out data with (Status = REV and SecretId IS NOT NULL combined) so the final result will be
User | SecretId | Status warheat1990 | NULL | REV warheat1990 | NULL | COM warheat1990 | 1 | COM
My query
SELECT * FROM TABLE WHERE User = 'warheat1990' AND (Status <> 'REV' AND SecretId IS NULL)
but it's not working because it gives me only this ROW.
User | SecretId | Status warheat1990 | NULL | COM
So how do I exclude data with Status = REV but only if SecretId IS NOT NULL
I feel stupid that I can't figure out this simple case. Any help will be appreciated.
原文:https://stackoverflow.com/questions/36637954
最满意答案
也许只是尝试做:
$(window).scrollTop($('#results').offset().top);
或者,如果你愿意,这里有插件为这种效果http://balupton.github.io/jquery-scrollto/
Maybe try to do simply:
$(window).scrollTop($('#results').offset().top);
Or if You prefer, here is plugin for this effect http://balupton.github.io/jquery-scrollto/
相关问答
更多-
为此,您可以为动画命令设置回调函数,该命令将在滚动动画完成后执行。 例如: var body = $("html, body"); body.stop().animate({scrollTop:0}, 500, 'swing', function() { alert("Finished animating"); }); 在哪个警报代码中,您可以执行更多的JavaScript来添加进一步的动画。 此外,“摆动”是设置宽松。 查看http://api.jquery.com/animate/了解更多信息 ...
-
您可以使用.animate() scrollTop属性,如下所示: $("html, body").animate({ scrollTop: "300px" }); You can just use .animate() the scrollTop property, like this: $("html, body").animate({ scrollTop: "300px" });
-
ScrollTop动画jquery(ScrollTop animate jquery)[2024-02-13]
还请包含jquery-ui.js以缓解效果。 然后你可以在语法中使用缓动效果.animate( properties [, duration ] [, easing ] [, complete ] ) 在你的例子中它将是 - $('body').animate({ scrollTop: top },1000,'easeOutElastic', function () { $prev.addClass('current'); }); Please also include jq ... -
您的滚动顶部无法正常工作,因为您必须添加“px”: $('.sectionlink').click(function(e){ var sectionelement = $(this).attr("rel"); var myoffset = $('#'+sectionelement).offset().top; $('html, body').animate({ scrollTop: myoffset+"p ...
-
也许只是尝试做: $(window).scrollTop($('#results').offset().top); http://jsfiddle.net/fuggetgk/ 或者,如果你愿意,这里有插件为这种效果http://balupton.github.io/jquery-scrollto/ Maybe try to do simply: $(window).scrollTop($('#results').offset().top); http://jsfiddle.net/fuggetgk/ Or ...
-
有时浏览器使用0px < val px < 1px 。 我的猜测是jquery动画滚动到一个值,例如。 window.scrollTop = 499.9 ,目的地为500 。 因此if( $(window).scrollTop() < v ){评估与之前相同。 要检查这个,你可以更换 $root.stop(true,true).animate({scrollTop: v},500); 同 $root.stop(true,true).animate({scrollTop: v},500, fu ...
-
动画jQuery的scrolltop(Animate jQuery scrolltop)[2023-10-23]
你可以为此使用animate() 。 应用于div示例代码如下所示: //Scroll to bottom $('div').animate({scrollTop: $('div').get(0).scrollHeight}, 3000); //$('div').get(0).scrollHeight - will give the full height of div. //scrollTop - will be used to animate from the current position to ... -
我的名字是Saucier(:在你的一段中 但至于你的问题,我能够用一些技巧来纠正这种情况。 第一个是我没有启动动画,直到imagePos <= topOfWindow ,这意味着手机的内容部分必须完全可见。 如果你想更改它以便更快地发生,请从imagePos减去 我改变的第二件事是你的主要问题所在。 在达到该点后,任何时候滚动窗口时,您的动画都会被触发。 为了解决这个问题,我添加了一个名为hasAnimated的布尔值来跟踪动画事件是否已经触发,并将所有动画放在依赖于该布尔值的if语句中。 if(!hasA ...
-
试试这个...... $('.arrow-up').click(function(){ $('html, body').animate({scrollTop : 0},300); return false; }); Try with this.. $('.arrow-up').click(function(){ $('html, body').animate({scrollTop : 0},300); return false; });
-
您需要相对于链接在元素中的位置以及相对于#boxMaster元素在#boxMaster元素中的top位置#boxMaster元素。 您可以通过将#boxMaster元素的scrollTop()值添加到其top位置,然后从链接的偏移top值中减去该值来执行此操作: $(this.hash).offset().top - $('#boxMaster').position().top + $('#boxMaster').scrollTop() 更新的示例 var $boxMaster = $('#boxMast ...