How to return efficiently filtered data

Dear all,
I have a database ( SQL server 2012) which is based from AW sample db where I took some sample table design to cover my issues.
My database will host a big list of product organized in category and sub category. From my client application I will provide a FIlter UI where user can defined filter criteria like Price, category name, sub category, name for instance.
I need to build a querry based on given criteria in order to return filter data in an efficient way. In order to get correct data back, based on db structure I will have to handle quite many joins.
What is the proper way to get filtering data out ?
-should I handle it from a single store procs and return the list of matching product ?
-should I handle separate view for each criteria and merge them all in a single view ?
- Any build in feature in SQL ?
I have never use such efficient criteria constraint that I need to implement, thanks for help
regards

I think you need read Erland's great article
http://www.sommarskog.se/dyn-search-2008.html
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence

Similar Messages

  • How to get the filtered data in ALV OO?

    Hi,
    i use ALV OO and want to get in my report the data wich a user has filtered.
    I have an output and have to count the some values of the filterd data. How can i
    get only the lines of the output wich are filterd?
    Regards, Dieter

    Hi Dieter,
      could method GET_FILTERED_ENTRIES be useful?
    http://help.sap.com/saphelp_erp2004/helpdata/en/0a/b552fdd30911d2b467006094192fe3/content.htm
    regards,
    Andrea

  • How can i transfer filtered data from diadem to excel?

    Hi,
    i'm trying to write a script which would allows me to transfer data automatically from diadem to excel and i need some help.
    i want to copy the last of my selected channels, open an excel file and paste data into it.
    My script look like this
    Dim ExcelTable
    Call DATABLCLPCOPY("1,137,139,142-168,172-225,227,229,231,233,235,237,239,241,243",j,1) '... CHNNOSTR,CHNROW,VALNO
    Set ExcelTable=GetObject("K:\...\Anl_kal_v3_2006.xls!SN1")
    ExcelTable.Application.Visible = True
    One problem is that i don't know how to continue and the other is that this script only get the programm MS-Excel started and don't open my file.
    I hope i explained it the way you could understand and so you could give me ur help.
    Thanks
    Patrick Etoumann

    Hi Patrick,
    In DIAdem we provide an example which shows the things you would like to do. The script name is "Expl_OLE.vbs". You find it in the folder ..\Libr\Aut\.
    I hope this will help you.
    Greetings
    Walter

  • How to return a specific date/time range and last event details, when checking the event log via command prompt

    I am new to scripting (literally started reading/learning scripting a few hours ago), and I am stuck in trying to get my current script/command to filter a specific date range.
    * Note: I am working with Server 2003 and 2008; because of the environment I am in, a lot of scripts (such as Powershell and VBScript) don't work; trying to stick with command line, as it appears to be the only thing that functions correctly in my environment
    I am trying to search the System log in event viewer, for the most recent server reboot. Here is the command that I am currently running:
    ===========================================================
    C:\Windows\System32\cscript C:\Windows\System32\eventquery.vbs /L System /FI "id eq 1074"
    ===========================================================
    When run, the output looks like this:
    ===========================================================
    Microsoft (R) Windows Script Host Version 5.6
    Copyright (C) Microsoft Corporation 1996-2001. All rights reserved
    Listing the events in 'system' log of host 'xxxxxxxxxxxxxxx'
    Type Event
    Date Time    Source
    Information 1074
    12/18/2013 2:48:06 AM    USER32
    Information 1074
    11/20/2013 3:25:04 AM    USER32
    Information 1074
    10/23/2013 2:06:09 AM    USER32
    ===========================================================
    What I would like it to do is only show events that have happened in the last seven days, as well as show the event details if it does find an event that matches the criteria.
    Any help would be greatly appreciated. Thanks!
    Nick

    I would prefer using Powershell , you can use below code 
    function Get-EventViewer
    param(
    [string[]]$ComputerName = $ENV:COMPUTERNAME,[string]$LogName,[int]$eventid
    $Object =@()
    foreach ($Computer in $ComputerName)
    $ApplicationEvents = get-eventlog -logname $LogName -cn $computer -after (Get-Date).AddDays(-7) | ?{$_.eventid -eq "$eventid" }
    foreach ($event in $ApplicationEvents) {
    $Object += New-Object -Type PSObject -Property @{
    ComputerName = $Computer.ToUpper();
    TimeGenerated = $event.TimeGenerated;
    EntryType = $event.EntryType;
    Source = $event.Source;
    Message = $event.Message;
    $column1 = @{expression="ComputerName"; width=12; label="ComputerName"; alignment="left"}
    $column2 = @{expression="TimeGenerated"; width=22; label="TimeGenerated"; alignment="left"}
    $column3 = @{expression="EntryType"; width=10; label="EntryType"; alignment="left"}
    $column4 = @{expression="Source"; width=15; label="Source"; alignment="left"}
    $column5 = @{expression="Message"; width=100; label="Message"; alignment="left"}
    $Object|format-table $column1, $column2, $column3 ,$column4 ,$column5
    $Object.GetEnumerator() | Out-GridView -Title "Event Viewer"
    You can do a function call like
    Get-EventViewer -LogName system -ComputerName "computername" -eventid "2017"

  • Extracting Filtered Data

    Hi,
    I have a sheet in Numbers which I have filtered to show only fields with a certain value. I want to copy these separated fields into a new sheet, but the copy and paste function only throws back the unsorted data. How can I extract filtered data to copy to another sheet?
    Thanks!
    Jim

    KOENIG Yvan wrote:
    Only an advice.
    Numbers developers thought that the available feature is matching the Apple Human Interface Guidelines requirements.
    Often, building a program is not a problem of competence but a problem of choice. The authors must define the needs of the target customers. Your hopes doesn't match these needs no more no less.
    Judging by some of the similar questions on this forum I would disagree - not all people want to use Numbers for high-end data processing! I, for example, am using it to compile my tax return, including earnings from multiple countries. The fact that it comes bundled as part of a home computer package would suggest to me that Apple have a broader market in mind than only those who have to manipulate data professionally.
    I'm quite intelligent enough to learn how to use this program; it's more a matter of the time I had to spend in trying to complete what I felt to be a relatively simple task. I can't believe that even for those who fall into your category of 'target customers', having continually to write long function scripts is welcome - even when clearly as competent as you are in doing so!
    Thanks to your kind help I've been able to accomplish what I needed, but I still feel that for such a simple task as filtering data and extracting it to another sheet Apple are, for once, falling somewhat short of their user-friendly reputation.

  • How to return a single datetime from multiple rows of MAX(value) in DAX

    Hi
    I have a Results table with ResultTime, Balance, Equity which is updated with a new row every 5 minutes. I've used SUMX to find opening and closing balances and it has worked so far.
    Res_OpeningBalance:=SUMX(TOPN(1,Results,Results[ResultTime],1),[Balance])
    Res_ClosingBalance:=SUMX(TOPN(1,Results,Results[ResultTime],0),[Balance])
    But when I tried it with dates, the whole thing fell apart.
    Res_MaxBalance_Date:=SUMX(TOPN(1,Results,Results[Balance],0),[ResultTime])
    Since the highest Balance is likely to be represented through many rows due to it lasting more than 5 minutes, ResultTime (which is unique to each row) is summed up and returns messed up dates well into the future. How to return only one date (first or last
    datetime) from the rows where Balance is at max?
    I tried a TOPN of TOPN, but Excel was not amused.
    =SUMX(TOPN(1,Results,Results[Balance],0),TOPN(1,Results,Results[ResultTime],0))
    TIA!
    Re
    Dennis

    I still don't understand RANKX, but I figured it out anyway. I get the correct data by using:
    Res_MaxBalance:=MAX(Results[Balance])
    Res_MaxBalanceDate:=CALCULATE(MAX(Results[ResultTime]),FILTER(Results, Results[Balance]=MAX(Results[Balance])))
    Res_MinBalance:=MIN(Results[Balance])
    Res_MinBalanceDate:=CALCULATE(MAX(Results[ResultTime]),FILTER(Results, Results[Balance]=MIN(Results[Balance])))
    Res_MaxEquity:=MAX(Results[Equity])
    Res_MaxEquityDate:=CALCULATE(MAX(Results[ResultTime]),FILTER(Results, Results[Equity]=MAX(Results[Equity])))
    Res_MinEquity:=MIN(Results[Equity])
    Res_MinEquityDate:=CALCULATE(MAX(Results[ResultTime]),FILTER(Results, Results[Equity]=MIN(Results[Equity])))
    Re
    D

  • How to do sorting/filtering on custom java data source implementation

    Hi,
    I have an entity driven view object whose data should be retrieved and populated using custom java data source implementation. I've done the same as said in document. I understand that Query mode should be the default one (i.e. database tables) and createRowFromResultSet will be called as many times as it needs based on the no. of data retrieved from service, provided we should write the logic for hasNextForCollection(). Implementation sample code is given below.
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams) {      
    Iterator datumItr = retrieveDataFromService(qc, params);
    setUserDataForCollection(qc, datumItr);
    hasNextForCollection(qc);
    super.executeQueryForCollection(qc, params, noUserParams);
    protected boolean hasNextForCollection(Object qc) {
    Iterator datumItr = (Iterator) getUserDataForCollection(qc);
    if (datumItr != null && datumItr.hasNext()){
    return true;
    setCallService(false);
    setFetchCompleteForCollection(qc, true);
    return false;
    protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet resultSet) {
    Iterator datumItr = (Iterator) getUserDataForCollection(qc);
    Object datumObj = datumItr.next();
    ViewRowImpl r = createNewRowForCollection(qc);
    return r;
    Everything is working fine include table sorting/filtering. Then i noticed that everytime when user perform sorting/filtering, executeQueryForCollection is called, which in turn calls my service. It is a performance issue. I want to avoid. So i did some modification in the implementation in such a way that, service call will happen only if the callService flag is set to true, followed by executeQuery(). Code is given below.
    private boolean callService = false;
    public void setCallService(boolean callService){
    this.callService = callService;
    public boolean isCallService(){
    return callService;
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams){
    if (callService)
    Iterator datumItr = retrieveDataFromService(qc, params);
    setUserDataForCollection(qc, datumItr);
    hasNextForCollection(qc);
    super.executeQueryForCollection(qc, params, noUserParams);
    Issue i have:
    When user attempts to use table sort/filter, since i skipped the service call and set null as userDataCollection, createRowFromResultSet is not called and data which i retrieved and populated to view object is totally got vanished!!. I've already retrived data and created row from result set. Why it should get vanished? Don't know why.
    Tried solution:
    I came to know that query mode should be set to Scan_Entity_Cache for filtering and Scan_View_Rows for sorting. I din't disturb the implementation (i.e. skipping service call) but overrided the executeQuery and did like the following code.
    @Override
    public void executeQuery(){
    setQueryMode(callService ? ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES : ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS);
    super.executeQuery();
    By doing this, i could able to do table filtering but when i try to use table sorting or programmatic sorting, sorting is not at all applied.
    I changed the code like beolw*
    @Override
    public void executeQuery(){
    setQueryMode(callService ? ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES : ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
    super.executeQuery();
    Now sorting is working fine but filtering is not working in an expected way because Scan_View_rows will do further filtering of view rows.
    Question:
    I don't know how to achieve both filtering and sorting as well as skipping of service call too.
    Can anyone help on this?? Thanks in advance.
    Raguraman

    Hi,
    I have an entity driven view object whose data should be retrieved and populated using custom java data source implementation. I've done the same as said in document. I understand that Query mode should be the default one (i.e. database tables) and createRowFromResultSet will be called as many times as it needs based on the no. of data retrieved from service, provided we should write the logic for hasNextForCollection(). Implementation sample code is given below.
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams) {
      Iterator datumItr = retrieveDataFromService(qc, params);
      setUserDataForCollection(qc, datumItr);
      hasNextForCollection(qc);
      super.executeQueryForCollection(qc, params, noUserParams);
    protected boolean hasNextForCollection(Object qc) {
      Iterator datumItr = (Iterator) getUserDataForCollection(qc);
      if (datumItr != null && datumItr.hasNext()){
        return true;
      setFetchCompleteForCollection(qc, true);
      return false;
    protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet resultSet) {
      Iterator datumItr = (Iterator) getUserDataForCollection(qc);
      Object datumObj = datumItr.next();
      ViewRowImpl r = createNewRowForCollection(qc);
      return r;
    }Everything is working fine include table sorting/filtering. Then i noticed that everytime when user perform sorting/filtering, executeQueryForCollection is called, which in turn calls my service. It is a performance issue. I want to avoid. So i did some modification in the implementation in such a way that, service call will happen only if the callService flag is set to true, followed by executeQuery(). Code is given below.
    private boolean callService = false;
    public void setCallService(boolean callService){
      this.callService = callService;
    public boolean isCallService(){
      return callService;
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams){
      if (callService) {
        Iterator datumItr = retrieveDataFromService(qc, params);
        setUserDataForCollection(qc, datumItr);
      hasNextForCollection(qc);
      super.executeQueryForCollection(qc, params, noUserParams);
    }Issue i have:
    When user attempts to use table sort/filter, since i skipped the service call and storing of userDataCollection, createRowFromResultSet is not called and data which i retrieved and populated to view object is totally got vanished!!. I've already retrived data and created row from result set. Why it should get vanished? Don't know why.
    Tried solution:
    I came to know that query mode should be set to Scan_Entity_Cache for filtering and Scan_View_Rows for sorting. I din't disturb the implementation (i.e. skipping service call) but overrided the executeQuery and did like the following code.
    @Override
    public void executeQuery(){
      setQueryMode(callService ? ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES : ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS);
      super.executeQuery();
    }By doing this, i could able to do table filtering but when i try to use table sorting or programmatic sorting, sorting is not at all getting applied.
    I changed the code like below one (i.e. changed to ViewObject.QUERY_MODE_SCAN_VIEW_ROWS instead of ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS)
    @Override
    public void executeQuery(){
      setQueryMode(callService ? ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES : ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
      super.executeQuery();
    }Now sorting is working fine but filtering is not working in an expected way because Scan_View_rows will do further filtering of view rows.
    If i OR'ed the Query Mode as given below, i am getting duplicate rows. (vewObject.QUERY_MODE_SCAN_ENTITY_ROWS | ViewObject.QUERY_MODE_SCAN_VIEW_ROWS) Question:
    I don't know how to achieve both filtering and sorting as well as skipping of service call too.
    Can anyone help on this?? Thanks in advance.
    Raguraman
    Edited by: Raguraman on Apr 12, 2011 6:53 AM

  • JSObject returns wrong date. How can I extract correct date from digital signature?

    I'm trying to extract name and date from digital signatures by using JSObject in Excel VBA, but JSObject returns wrong date. Year, month, hour and minute are correct, but only day is incorrect.
    Here is my code. I'm using Acrobat 8.1.3.
    Please tell me what's wrong with this code and how I can extract correct date from digital signatures.
    Public Sub sbTest()
    Dim oApp As Acrobat.acroApp
    Dim oPDDoc As Acrobat.AcroPDDoc
    Dim jso As Object
    Dim f As Object
    Dim sig As Object
    Dim strFileName As String
    Set oApp = CreateObject("AcroExch.App")
    Set oPDDoc = CreateObject("AcroExch.PDDoc")
    strFileName = "C:\Test.pdf"
    If (oPDDoc.Open(strFileName)) Then
    Set jso = oPDDoc.GetJSObject
    Set f = jso.getField("Signature1.0")
    Set sig = f.signatureInfo()
    Debug.Print sig.Name
    Debug.Print sig.Date
    End If
    Call oPDDoc.Close
    Call oApp.Exit
    End Sub

    Hi
    You can use TDMS file format to save the data. I have attached a reference Vi.
    On button click you can log the data or remove the case structure and continuous log the complete acquisition data.
    Thanks and Regards
    Himanshu Goyal
    Thanks and Regards
    Himanshu Goyal | LabVIEW Engineer- Power System Automation
    Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
    It Only gets BETTER!!!
    Attachments:
    Data Save in File.vi ‏35 KB

  • How can I return the current Date in Java?

    I am new to Java, and basically I want to know how I can return the current date as a variable, so for example, I have declared the following date variable
    private java.util.Date currentDate;How can I return the current date, do I have to write a method? To be more specific, I need to write a setMethod, that simply returns the current Date in Java.
    Please point me in the right direction.
    Thanks,

    If all you want is a date for printing or displaying, the easiest way is to use Date as shown below. If you need something more complex, look at the Calendar API.
    import java.util.Date;
    class DateEx
         public static void main(String args[])
              Date now = new Date();
              System.out.println(now);          
    }

  • How to return a set of data  by using webservice ?

    Hi.
    I am finding how to return a set of data by using java webservice that serves clients written by others such as VB. Net. Please help me !
    Thanks in advance.

    Check the how to on Accessing Oracle9iAS Java Web Service from a .NET Client
    http://otn.oracle.com/sample_code/tech/java/codesnippet/webservices/index.html
    Chandar

  • How to return data from Ejb as collection to Front End application.

    Hi,
    I am creating a J2ee application. Here i am accessing BAPIs using stateless session bean through JCO connection. Now the BAPI is returning a return Table and return Structure to the EJB.
    I have coded the following code in one of the Ejb Method as follows:
    JCO.Table returnTable = null;
    JCO.Structure returnStructure = null;
    JCO.ParameterList paramList = siteBAPI.getExportParameterList();
    JCO.ParameterList paramList2 = siteBAPI.getTableParameterList();
    returnTable = paramList2.getTable("SITE_SUBSITE_INSTL");
    returnStructure = paramList.getStructure("BAPIRET2");
    Now i want to sent this data( returnTable & returnStructure) to front end application where front end developer accessing this returned data using Jsp.
    My scenario is that , first i want to convert this returnTable & returnStructure in a single collection and then sent this collection to Front end.
    My aim is that , the front end the application should not receive the Data, using JCO.table Variable but as a single Collection.
    I am using NWDI-2004s sps10.
    i need urgent help on this issue and i would really appreciate if somebody can put the answer with some sample code on how to return the data as Collection.

    if you want to return a result, then you probably shouldn't be using a message bean. message beans for for asynchronous tasks. session beans for for synchronous tasks. thus it would make much more sense to have your jsp call the session bean directly.

  • How to Return Data Update

    I have two questions here.
    How do I return the full data set.
    (and with a callback would be nice.)
    How do I send a single record back to
    the server. (callback would be nice here also)
    What I am trying to do is make a complete editor example for
    the Mid=Michigan ColdFusion User Group meeting on Tuesday. This
    would be great way to show off spry! (Data in row, select and shows
    detail in side view, select edit and it hides the detail and pulls
    up edit view/ which could be for new or edit actually, and lastly
    submits the data to the server. If submit is successful... which is
    why I desire the call back... I need to get the result back from
    CF... then it will update the data/or add data accordingly.) Looks
    like I will use the accordian to show the edit/detail view so they
    can swap back and foward. We will enjoy seeing the new features of
    the effects when that day comes.
    OH, I will not be attending in person... this code is going
    to get packaged and needs to be online tomorrow evening. So if you
    guys could give some quick tips on that... will be on a 13 hour
    work day... so not much time to build it. Currently I am aquainted
    with prototype but want to do this as spry as I can.)

    Hello Forest lin,
    I recommend to post this query to the [BusinessObjects Enterprise Administration|BI Platform; forum.
    This forum is dedicated to topics related to administration and configuration of BusinessObjects Enterprise, BusinessObjects Edge, and Crystal Reports Server.
    It is monitored by qualified technicians and you will get a faster response there.
    Also, all BOE Administration queries remain in one place and thus can be easily searched in one place.
    Best regards,
    Falk

  • HOW TO GET FILTERED DATA

    HI All,
    I have an query, i have data like how to get filtered data
    i have data like below
    we have started this report with below data for Oct 2014 to Dec 2014
    QUARTER
    STATE
    COUNT
    Oct 2014 - Dec 2014
    U.P
    70
    Oct 2014 - Dec 2014
    M.P
    0
    Oct 2014 - Dec 2014
    BIHAR
    3
    Oct 2014 - Dec 2014
    MAHA
    50
    Oct 2014 - Dec 2014
    RAJ
    3
    so it was very easy to generate report
    then we get data for Jan 2014 to March 2014
    QUARTER
    STATE
    COUNT
    Oct 2014 - Dec 2014
    U.P
    70
    Oct 2014 - Dec 2014
    M.P
    0
    Oct 2014 - Dec 2014
    BIHAR
    3
    Oct 2014 - Dec 2014
    MAHA
    50
    Oct 2014 - Dec 2014
    RAJ
    3
    Jan 2014 - Mar 2014
    U.P
    77
    Jan 2014 - Mar 2014
    M.P
    1
    Jan 2014 - Mar 2014
    BIHAR
    4
    Jan 2014 - Mar 2014
    MAHA
    77
    Jan 2014 - Mar 2014
    RAJ
    5
    so we applied filter on quarter manually for generating the report
    now we have data like below
    QUARTER
    STATE
    COUNT
    Oct 2014 - Dec 2014
    U.P
    70
    Oct 2014 - Dec 2014
    M.P
    0
    Oct 2014 - Dec 2014
    BIHAR
    3
    Oct 2014 - Dec 2014
    MAHA
    50
    Oct 2014 - Dec 2014
    RAJ
    3
    Jan 2014 - Mar 2014
    U.P
    77
    Jan 2014 - Mar 2014
    M.P
    1
    Jan 2014 - Mar 2014
    BIHAR
    4
    Jan 2014 - Mar 2014
    MAHA
    77
    Jan 2014 - Mar 2014
    RAJ
    5
    Apr 2014 - Jun 2014
    U.P
    186
    Apr 2014 - Jun 2014
    M.P
    18
    Apr 2014 - Jun 2014
    BIHAR
    74
    Apr 2014 - Jun 2014
    MAHA
    189
    Apr 2014 - Jun 2014
    RAJ
    68
    now as per new requirement they want only this quarter data of Apr 2014 to Jun 2014
    Apr 2014 - Jun 2014
    U.P
    186
    Apr 2014 - Jun 2014
    M.P
    18
    Apr 2014 - Jun 2014
    BIHAR
    74
    Apr 2014 - Jun 2014
    MAHA
    189
    Apr 2014 - Jun 2014
    RAJ
    68
    and requirement like we have to automate this process . means report should contain only current quarter value.
    so my  query is how to achieve this
    please suggest
    I am using SAP BO 3.1
    Thanks in advance
    Jeet 

    Hi Jeet,
    You can try this-
    Create variable
    V_Quarter= if Left(<QUARTER>,3)="Jan" then 1 elseif Left(<QUARTER>,3)="Apr" then 2 elseif Left(<QUARTER>,3)="Jul" then 3 else 4
    V_Year= Right(<QUARTER>)
    V_CurrQuarter=Quarter(CurrentDate())
    V_CurrYear=Year (CurrentDate())
    Apply filter on report
    V_Quarter= V_CurrQuarter and V_Year=V_CurrYear
    -Anuj

  • Filtering data in SQL

    What is the most efficient way of filtering data in SQL.
    This is what I'm trying to do:
    SELECT
    a.something,
    a.somethingelse
    FROM      
    atable a
    WHERE a.id = 6000
    AND a.name != 'this' OR a.name != 'that'
    ORDER BY a.something;
    Considering I will be executing this query on a database whose size will be in Gigabytes.
    Any suggestions?

    A summery and some comments:
    This query:
    SELECT
    a.something,
    a.somethingelse
    FROM      
    atable a
    WHERE a.id = 6000
    AND a.name != 'this' OR a.name != 'that'
    ORDER BY a.something;is equivalent to this one:
    SELECT
         a.something,
         a.somethingelse
    FROM      
         atable a
    WHERE (a.id = 6000 AND a.name != 'this')
           OR a.name != 'that'
    ORDER BY a.something;so it will return all rows verifying:
    (id = 6000 AND name IS NOT NULL) OR (name != 'that' and name IS NOT NULL) !
    Now, this one :
    SELECT
         a.something,
         a.somethingelse
    FROM      
         atable a
    WHERE a.id = 6000
           AND (a.name != 'this' OR a.name != 'that')
    ORDER BY a.something;will filter on id = 6000 but nothing on "name" except for NULLS. I mean all rows
    with id = 6000 and name NOT NULL are returned.
    As others indicated, you would perhaps want to replace OR by AND and then the query becomes:
    SELECT
         a.something,
         a.somethingelse
    FROM      
         atable a
    WHERE a.id = 6000
           AND a.name != 'this'
           AND a.name != 'that'
    ORDER BY a.something;You have to consider name != 'SomeNotNullValue' as equivalent to
    (name != 'SomeNotNullValue' AND name IS NOT NULL).
    The above is true for all comparaison operators.

  • I lost my iPhone device, how can I get my data back on another one without using an iCloud backup just back up on i Tunes, Please Help.

    I lost my iPhone device, how can I get my data back on another one without using an iCloud backup just back up on i Tunes, Please Help.??

    You can find the backup files and then copy them to a safe place if you are worrying about this.
    iTunes places the backup files in these places:
    Mac: ~/Library/Application Support/MobileSync/Backup/
    The "~" represents your Home folder. If you don't see Library in your Home folder, hold Option and click the Go menu.
    Windows Vista, Windows 7, and Windows 8: \Users\(username)\AppData\Roaming\Apple Computer\MobileSync\Backup\
    To quickly access the AppData folder, click Start. In the search bar, type %appdata%, then press Return.
    Windows XP: \Documents and Settings\(username)\Application Data\Apple Computer\MobileSync\Backup\
    To quickly access the Application Data folder, click Start, then choose Run. In the search bar, type %appdata%, then click OK.

Maybe you are looking for

  • Report on Stock in storage bin

    Dear Guru My client wants a report where in MF60 they will get the required quantity to be transferred from raw storage location  to production location.They want a report in which the stock to be transferred  from raw storage location is in which st

  • Mapping issue in 10gr2

    Hi All, We are using OWB 10gR2 and database 10.2.0.2 . We have a mapping loading data into fact. We use sysdate to update the "inserted_date" and "last_updated" columns. Mapping is inserting corrupt data into these date fields. Really don't know why?

  • Ipod Nano pauses frequently mid-song for no apparent reason

    Can any help me figure out why this is happening? My Ipod nano pauses on its own very often while I run. Anyone have any ideas what is making this occur?

  • Validations transport request

    Hi All I have created a validation, but I didn't got the transport request no. Please let me know how to transfer the transport the validation or how to create the transport reqest for my validation. Best regards Madhavi

  • Questions for client

    Hi, Can anyone provide me with questions I need to ask the client for configuration purposes in the blueprint phase for FI and CO modules? or how can I access such questions? Thanks