What is the sql command for SELECT with OR condition

Hi
What is the correct sql command for doing select with or condition??
SELECT * from TempData
WHERE port = '123'
OR serialnumber = '555'
So if there is a port = 123 or if there is a serialnumber = 555, I will get a successful select.
Thanks for helping a newbie!!

Hi
What is the correct sql command for doing select with
or condition??
SELECT * from TempData
WHERE port = '123'
OR serialnumber = '555'
So if there is a port = 123 or if there is a
serialnumber = 555, I will get a successful select.
Thanks for helping a newbie!!Make sure you bracket your OR conditions
eg
SELECT * from TempData
WHERE column = 'VALUE'
and port = '123'
OR serialnumber = '555'
is read as
SELECT * from TempData
WHERE (column = 'VALUE'
and port = '123' )
OR serialnumber = '555'
which is not the same as
SELECT * from TempData
WHERE column = 'VALUE'
and ( port = '123'
OR serialnumber = '555' )

Similar Messages

  • I just got iTunes 11.0. I'm used to being able to return to the beginning of a song by hitting 'enter'. What's the new command for skipping to the head of a song?

    I just got iTunes 11.0. From all the previous versions I'm used to being able to return to the beginning of a song by hitting 'enter'. What's the new command for skipping to the head of a song?

    Mmmmmm. Works OK for me. I've tried every variation I can think of. Play from playlist, play from library, shuffle on, shuffle off, single song repeat on/off, playlist repeat on/off.
    WAIT !!   Now I've found it  !!  It happens when I have the sidebar hidden and play a playlist from the PLAYLIST pane. Hitting Enter then takes me to the FIRST song in the playlist.
    WAIT AGAIN !!! In the time it took to write the above, it changed again and works properly. Well properly is not really true. It works if I stay in the PLAYLIST pane. If I switch to the SONGS, ALBUMS or ARTISTS pane, enter does nothing. BUT, if I switch to the GENRES pane, enter starts the first song there. AND, if I've switched away from the PLAYLIST pane and switch back, enter then starts the first song in the playlist.
    WOW !! That was a crazy ride. I think we can safely say that there is something awry.

  • What is the SQL Standard for passing back a 0 in an Amount Field

    So I have an Amount Column in my database. What is the best way and the SQL Standard to pass back a 0 if it is a <NULL>? With a COALESCE statement?
    Thanks for your review and am hopeful for a reply.

    This is UNBELIEVEABLE! I got rid of my TextBox13 all together...Deleted it to start from scratch. And it is still erroring on TextBox13!!! I even checked the Properties List and there is no TextBox13. What in God's name is going on here?!?!?
    Am I missing something???
    Hi ITBobbyP,
    As to this issue, I find that this is a known issue which you can see on the link below:
    http://connect.microsoft.com/SQLServer/feedback/details/649210/bids-sql-2008-r2-warnings-not-clearing
    According to the Feedback, we can workaround this known issue by Re-open the project. And if Warning was in fact resolved, it will no longer show on the Business Intelligence Development Studio (BIDS) "Error List".
    As to your former issue, please refer to the expression post by
    Jingyang Li.
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • What Is The Terminal Command For PRAM & SMC Reset?

    Hi Folks - Cant get my Macbook Pro to shut down (instead it does a re-start) thus the key combination for these re-sets doesnt seem to function (no chimes). I saw in another thread a terminal command entry "sudo nvram boot-args=”-p -r” but I also saw it mentioned that entering that casued the following to pop-up "Note that resetting the PRAM will wipe out the contents of the boot-args environment variable, which means the command would need to be reissued each startup." Whats with "reissued each startup"? Also would like a an SMC re-set command. THANKS in advance!

    I dont know of a terminal command but here is how to reset the SMC:
    Resetting the System Management Controller (SMC)
    Resetting the SMC on Mac portables with a battery you can remove
    Shut down the computer.
    Disconnect the MagSafe power adapter from the computer, if it's connected.
    Remove the battery (to remove the battery - click here: MacBook or MacBook Pro).
    Press and hold the power button for 5 seconds.
    Release the power button.
    Reconnect the battery and MagSafe power adapter.
    Press the power button to turn on the computer.
    Resetting the SMC on portables with a battery you should not remove on your own
    Shut down the computer.
    Plug in the MagSafe power adapter to a power source, connecting it to the Mac if its not already connected.
    On the built-in keyboard, press the (left side) Shift-Control-Option keys and the power button at the same time.
    Release all the keys and the power button at the same time.
    Press the power button to turn on the computer.

  • What does the /O command in combination with images?

    When I use Acrobat 8 to print scanned images to a postscript file an additional images is generated in the postscript file. Dependent on the value (1 or 2) behind the "/O" command this image appears in the pdf after I distilled the postscript with Distiller 8. Does anyone know what this "/O" command does or I can manipulate it with a setting in Acrobat 8?
    Thanks in advance.

    /O isn't a command. It's a normal name. Some procedure somewhere is
    called which will (presumably) look for this name and process it. So
    you need to read the procedure, rather than look for PostScript
    definitions.
    Aandi Inston

  • What is the sql statement for doing this?

    Hi,
    I am currently doing a simple search engine that allows a user to key in a filename and display all the files' name close to keyed filename(the first two letters are the same).What is the proper sql statement to select from Document according to DocumentType and the first two letters of the filename? Am i doing it the right way? I am currently use Access 2002, dunno if it will affects me.Thanks in advance
    [What i did]
    String filename="doc,txt"
    SELECT DocumentType from Rule where UserType='1' and Action='Search';
    DocumentType=1,5,9,13,17,21,25,29,33,37,41,45 // This is all the document Type the user can see.
    Next i used StringTokenizer break the DocumentType.
    DocumentType[0]=1;
    DocumentType[0]=5;
    SELECT * from Document where DocumentType and Name <<< I want to select from Document according to DocumentType and the first two letters of the filename

    One more try - from what I can follow?
    If I assume you have a table named for example "UserRules"
    which has fields UserID,UserType,UserAction
    and has records like this that controls the document types
    a user is allowed to see
    UserID UserType Action
    TOM 1 Search
    BILL 7 Search
    ROY 2 Search
    And if I assume you have a table named for example "AllowedUserDocumentTypes"
    which has fields UserType,DocumentTypes
    and has records like this that controls the document types
    a user is allowed to see
    UserType DocumentTypes
    1 1,3,4,5,6,19
    2 7,9,12,18
    3 1,19,33,27
    And you have the document table which has
    fields are DocNo,Name,Title,Date,Filename,DocumentType
    and it has records like this
    DocNo Name Title Date Filename DocumentType
    12345 BILL Cars CarTypes 18
    12346 ROY Trucks TruckTypes 2
    12347 TOM Toys ToyTypes 17
    12345 JACK Car Colors CarColors 19
    12345 TOM Car Shapes CarShapes 7
    Then the select statement
    Select DocumentTypes from AllowedUserDocumentTypes
    join UserRules where UserRules.UserType = AllowedUserDocumentTypes.UserType
    and UserRules.UserID = 'ROY' and UserRules.Action = 'Search';
    will return 7,9,12,18
    If the DocumentType field is numeric and the user entered "CarCrap" the
    select statement would have to look like this
    SELECT * from Document
    where left(Filename,2) = 'Ca' and DocumentType in (7,9,12,18);
    If the DocumentType field is say varchar
    select statement would have to look like this
    SELECT * from Document
    where left(Filename,2) = 'Ca' and DocumentType in ('7','9','12','18');
    You will have to build these select statements related to the user.
    Note you should also allow for upper and lower case differences. I
    would suggest you convert the user entry into uppercase and do a select
    like below
    SELECT * from Document
    where Ucase(left(Filename,2)) = 'CA' and DocumentType in (7,9,12,18);
    This is all written from memory, not tested and I have not done this
    in several years.
    I was showing approximately how to build the statements before.
    rykk

  • What is the sql query for the real time reports Resource Stats?

    Does anyone know what the query is that the real time report tool uses for the Resource Stats page?  Trying to develop a custom report that displays similar information that is updated regularly.

    Hi,
    009 wrote:
    Hi Frank,
    Just wanted your opinion on the above given SQLI'm not sure I understand it.
    I added some more formatting to help me read it:
    SELECT      A
    ,     CASE WHEN LAG(A,1) OVER (ORDER BY A) IS NULL
              OR A=LAG(A,1) OVER (ORDER BY A)
              THEN LAG(B,1) OVER (ORDER BY A)
         END B_LAG
    ,     B
    FROM     (
         SELECT A, B
         FROM
              SELECT '1'A,'Apple' B FROM DUAL UNION ALL
              SELECT '1'A,'cat'B FROM DUAL UNION ALL
              SELECT '2'A,'bat'B FROM DUAL UNION ALL
              SELECT '3'A,'rat'B FROM DUAL UNION ALL
              SELECT '2'A,'yellow'B FROM DUAL UNION ALL
              SELECT '1'A,'pin'B FROM DUAL
         CONNECT BY PRIOR A=B
         ORDER BY A
    );What is the purpose of the CONNECT BY in what you have so far?
    Is the idea that you will add another CONNECT BY query, using
    CONNECT BY  b_lag  = PRIOR b?
    Do you think that will be better than using ROW_NUMBER?
    Will it work if (a, b) is not unique?

  • What is the best printer for use with iMac osx lion 10.7.4

    What is the best printer to purchase for use with imac osx lion 10.7.4. Preferably an all-in-one with wireless capabilities. around $125-$150

    JDLASK wrote:
    I WOULD RATHER NOT PAY MORE THAN ABOUT $125.00 IF POSSIBLE.
    Please don't use all Caps. It's considered shouting. And please don't keep doubling up on your posts.
    Thanks
    Pete

  • What is the device Code for IPAD with OS 7.2

    If I want to hear music coming through YOU TUBE, I an required to provide Device Code Number for my Ipad. What is it?

    The Adoint Jot Pro Fine Tip stylus is the best stylus for the iPad. It's lightweight and feels natural, like a normal pen. Works great even with a screen protector.

  • What's the best webcam for Mac with tilt/pan/zoom?

    I am trying to find a good quality webcam to use for videoconferencing with my Mac (MacBook Air actually). The camera is to be positioned on the 60-inch screen on the wall in our boardroom so the built-in Facetime camera doesn't do the job. It needs to have tilt/pan/zoom (in software). When I started on this search I had no idea such a thing was going to be so hard to find. There is no shortage of such products for Windows but I can't find a single one for the Mac.
    There are a lot of webcams that claim to support Mac but on closer investigation not a single one of them (that I've found so far anyhow) provides any conrol features like tilt/pan/zoom - nor even brightness and contrast control for that matter. Maybe I'm looking in the wrong places because it's hard to believe the Mac world really is lacking such products. Can anyone point me in the right direction? Would be much appreciated.

    You're most welcome, Julie.
    dreamdoc wrote: ... I don't have a cam corder, but that's a great solution ...
    If you are still shopping, you might be able to find a compatible used camcorder at a local store that sells used cameras or electronics. One with a failed tape mechanism that otherwise works would likely be very low priced.  The same store may also have compact tripods.
    Because your MBA is so portable, it is easy to take with you so you can test any camcorder before you buy to be certain it meets your needs.
    dreamdoc wrote:... I also appreciate the reminder to close out my inquiry...
    Per the Respond to answers tutorial page, you decide when to mark an answer that "solves your question."
    I certainly did not intend any reminder.  As a user like you, I have not authority to remind or otherwise instruct you about your participation in Discussions.  As explained in ¶ 1.11 of Apple Support Communities - Terms of Use, the Apple Hosts would be the ones who would address any concerns with you if necessary.
    Have fun shopping!
    Message was edited by: EZ Jim
    Mac OSX 10.8.5

  • What is the best workflow for AVCHD with iMovie/iDVD 09?

    I am recording AVCHD video with a Sony HDR-SR11. I don't have a blu-ray burner yet, so I want to create the highest quality DVD's I can from this source video using my MacBook and the software I have (iMovie 09 and iDVD 09).
    Currently I am importing the video clips into iMovie 09 at the 1920x1200 setting. After creating a 16:9 movie I choose "Share to Media Browser" and export at the highest setting I see (I think 1280x720, I'm not on the MacBook at the moment).
    After a long while this completes and I launch iDVD 09. I drag the movie I exported above into the theme and burn at Professional Quality. After another long wait I have my DVD but I'm quite disappointed with the video quality.
    Even taking into account that DVD is not a hi-def disc format it seems like the video quality should be better. Is there a better workflow I should be using with this combination of software? Maybe some way to avoid scaling/compressing the video twice? Or is this as good as it gets with iMovie 09 and iDVD 09? I may have access to iMovie 06, if that would help.
    Thanks,
    Gerald

    3) Share to Media Browser with Best Quality
    For folks like me that wonder exactly how did you do this:
    (I don't know what Media Browser is yet.)
    I did this: (I got some warnings - did you?)
    In iMovie:
    Selected my 1280x720 "HD" video in the Project panel,
    Share->Media Browser...
    - if HD is greyed out, you already shared this size to Media Browser, go to next step,
    or select "Remove from Media Browser, check HD, click Remove"
    - if HD is not greyed, but is not check marked,
    select Computer icon, then uncheck Mobile, Med, and Lrg, leaving only HD checked
    With HD checked, Click Publish - watch "Creating the HD movie.."
    Bring up iDVD, Select Create a new project, browse for location and enter project name
    If Themes at bottom right is not selected (Dark), click it
    Double click a theme - for example under Revolution, choose Chapters.
    At bottom right, select Media, At top right, select Movies
    Under iMovie should be your iMovie project - mine says "My First Project" (I didn't name iMovie proj)
    Select your iMovie Project,
    you should see a thumb of your video with dimension, size listed
    (movie duration is down at bottom right.)
    Drag the thumbnail onto the iDVD preview window (I don't what that window is officially called)
    drop it under the theme title "Revolution Chapters" for this example
    You should see a running preview of your video with the project name below it.
    Important step: Project->Project Info, Under Encoding: select Best or Professional Quality
    Ok re-encoding warning, close Proj Info window.
    File->Burn DVD... Popup says "Warnings in Project", select Continue Burning
    Insert DVD (Apple designed sharp edges on the SuperDrive on purpose?)
    I used Staples 4x DVD-RW first.
    Watch process proceed till DVD is ejected...Don't believe "Time remaining: about one minute"
    My DVD-R120 player-recorder would not load the disk. It played fine on iMac, a WindowsXP laptop, and a Windows XP desktop. This DVD machine only likes old 1X RW media for some reason. I wish someone made a standalone Blu-Ray recorder/player. I burned a second copy to some gold Sony 1X/2X DVD-RW media, and this disk played fine.
    Picture quality is soft compared to HD material, but the moire patterns on some edges is only somewhat reduced over the Share to iDVD version. This Share to Media Browser version is acceptable for folks that won't go to Vimeo or YouTube to see my videos in HD.

  • Voice Control - does it learn and what's the "Wrong" command for?

    1) Like others, I find Voice Control laughably inaccurate sometimes when trying to get it to play an artist. I'm wondering if it "learns" and gets better the more you use it?
    2) In the manual, there's a command you can called "wrong" or "nope". In what situation would I use it? Whenever I've tried so far, by the time I get to say it, the original (incorrect) command has already executed!

    "Wrong" or "No" is for stopping a command and returning voice control to the listening phase. "Cancel" takes you out of voice control. If the command is to play or call a specific name, you can cancel it, but if it's a simple command like "play", "shuffle", "genius", or "what's playing" there is no cancel.
    VC for iPod control seems to have a serious bug. It's not inaccurate, it's just not working.
    There seems to be a condition where it will only recognize the first few artists in your library, and often not at all. I have restored my phone several times, rebuilt my iTunes library on the PC, and have yet to get it working properly.
    I have experienced, variously, after each restore and reload of the phone:
    - Voice control will not start, or never gets to where it is listening (with the waveform). This can usually be fixed by a hard reset.
    - Only artists from the first part of the alphabet are recognized. Only albums by these artists are recognized, regardless of letter. If I say anything else, it will pick the artist/album from these artists that sounds the most like what I say. One time it was artists A-F, the other time it was just the first 4 "A" artists. Contacts and playlists are recognized OK.
    - Even worse: No artists, albums, or playlists are recognized. Simple commands and contacts still work. This is where I'm at now, after a clean load of iTunes, a newly built iTunes library, a complete restore of the iPhone software, and set up as a NEW phone (no backup restored). That's as clean as you can get.
    I've been to the Genius Bar, and I've called support. Both times they have escalated my case to an an engineer. Apple is willing to replace my phone in-store tomorrow, but I don't think it is a hardware problem: The mic works, the headset mic works, and other VC features work.
    The only thing I can think of at this point is there is some artist/album name in my library that is causing it to fail?

  • What is the sql query for this

    table Employee
    EmpId
    Name
    MonthlySalary
    DateofJoining
    Suggest  a sql server query to find out the employee details whose having salary greater than their yers of experiance 
    nravhad

    Hi ,
      As this seems to be a kind of lab exercise question for learning purpose , i am giving you the pseudo code which will help to solve this problem and learn.
      select <the requeired columns> from employee table.
      where Find the no of years between dateofjoining and current date using DATEDIFF function< monthly salary
      if this is not a lab exercise problem for learning purpose , please forgive my ignorance.
    Best Regards Sorna

  • What is the keyboard command  for opening the disc drive on a G5

    fried old keyboard and am using an older one that doesn't have an "open" button. Thanks in advance

    Yes, it’s the same for me. In this case I didn’t know about drutil. I don’t want to take this off-topic, but just a quick question to you, chorleyman: I see you’re using a Firebox. Are you satisfied with it? I believe it’s Core Audio compliant. Back then I had to decide to get the Edirol FA-66 or a Presonus Firebox. I’m absolutely happy with mine, but I’m just curious...

  • What is the parallel command to select in Java?

    I mean if 2 or more process try to connect me how can I accept them all?

    I mean if 2 or more process try to connect me how can
    I accept them all?Normally you have a thread that reads and puts messages in a queue. Then one or more other threads pull messages from the queue and process them.
    If however, you really want the select() idiom then you need to look at the nio package. (And search the site for a particularly nice long post which provides an example on using it.)

Maybe you are looking for

  • Dynamic Data Driven Color in Chart

    Post Author: csmith CA Forum: Charts and Graphs I am working on a report which needs to produce approx. 100 charts.  One of the requirements is to dynamically color the bars of the chart (alerts) dynamically based upon a field in the database.  The l

  • A script that will query for the last successful backup to tape across all protected datasources

    I've searched trying to locate an existing script for this and come up empty so far but essentially what I am trying to do is have a script I can run that will query for the latest backup to tape that succeeded for each data source across all of the

  • ODBC gateway in windows connecting local oracle to local mysql

    I have setup a test system in my local Vista pc with oracle 11g and mysql. Just installed ODBC gateway and follow the instruction. The listener sid for ODBC started OK. But when I tried tnsping <sid>, it failed with tns-03505 failed to resolve name.

  • Organizational unit

    Hello, I need an explanation what is an organizational unit thanks, Iris

  • Enhancement Spot ES_SAPLMEWQ

    Hello, I'm trying to implement the enhancement spot ES_SAPLMEWQ for BAPI_REQUISITION_CREATE. You can view the ES in SE18, but when trying to create an implementation in SE19 nothing happens, not even a message is displayed. Any ideas? Thank you, A