Please tel me which one is good approach of joining.

Dear all, 
Table_2 has following data
c             na
7.000 k
3.000 j
32.000 g
Table_1 has following data
c             na
1.000 l
2.000 m
34.000 h
na is primary key for both tables.
i want only h and g should come in one row
select * from [Table_2] a CROSS JOIN table_1 b 
where a.na='g' and b.na='h'
and a.c> b.c
select * from [Table_2] a inner JOIN table_1 b 
on a.na='g' and b.na='h'
and a.c> b.c
select * from [Table_2] a , table_1 b 
where a.na='g' and b.na='h'
and a.c> b.c
please tel me which one i should follow,
as i can see  na is primary key so there can be other better methods also
please suggest.
yours sincerly

All ways lead to Rome, they say, but I certainly prefer the solution with CROSS JOIN.
The solution with INNER JOIN could make sense depending on the business rules, but in such case I would write it as:
SELECT *
FROM   [Table_2] a
JOIN   table_1 b ON a.c> b.c
WHERE  a.na='g'
  AND  b.na='h'
Or even:
SELECT *
FROM   (SELECT * FROM Table_2 WHERE na = 'g') AS a
JOIN   (SELECT * FROM Table_1 WHERE na = 'h') AS b ON a.c > b.c
I don't want the filtering on the individual columns in the ON clause for the JOIN. But admittedly, I rarely write queries in this style. Basically, I only do it if I do a full outer join (because else the query easily goes out of hand.)
The last version with a comma is very similar to the CROSS JOIN solution. However, while comma can be seen as a CROSS JOIN operator, it has a different precedence, which can result in unexpected compilation errors if you more JOIN operators to the query.
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • Please tell me which Ipod dock adapter is compatible with the Ipod Classic 80GB?  They no longer make this particular Ipod and I need the right dock adapter for my Panasonic SC-HC25 stereo system I recently purchased.

    Please tell me which Ipod dock adapter is compatible with the Ipod Classic 80GB?  They no longer make this particular Ipod and I need the right dock adapter for my Panasonic SC-HC25 stereo system with universal dock for Ipod/Iphone I recently purchased.
    You can also send my answer to [email protected]
    Thanks in advance for all who will help.
    slovebk

    refer to this Apple support Article, on Universal Dock which retail at $59 at Apple store.
    http://support.apple.com/kb/HT1380
    Look through the compatible list chart and see which 80GB model are you using, either ID 9 or 10. you can order through Apple Online Store.
    Have a nice day!

  • Can anyone please tell me which version of Photoshop Elements will download easily and run with mac 10.5.8 Snow Leopard?

    I posted a question which was: Can anyone please tell me which version of Photoshop Elements will work with Mac 10.6.8 Snow Leopard.  Then this window popped up saying mark this discussion with as a question and this window.  I have no idea how this works. It already is a question and if I need to emphasize that, how does this window that looks like a Word editing window, help me do that?Downloading, Installing, Setting Up

    You asked the question in the title area instead of the area where the body of your posting is intended to be.  No fault of yours - they need to make the form clearer.
    Check the system requirements for the various versions of Photoshop Elements and see which suits your system.  Adobe only sells the most recent versions of their software, so if you need an older version you will need to find a vendor for it.
    System requirements | Adobe Photoshop Elements

  • We have many mappings, which one is good in performance wise ?

    We have many mappings, which one is good in performance wise ?

    HI
    Different Mapping Techniques are available in XI. They are: Message Mapping, XSLT Mapping, Java Mapping and ABAP mapping.
    u2022The integration repository includes a graphical mapping editor. It includes built-in functions for value transformations and queue and context handling.  There is an interface for writing user-defined functions (java) as well.
    u2022XSLT mappings can be imported into the Integration Repository; java methods can be called from within the XSLT style sheet. Advantages of this mapping are: open standard, portable, extensible via Java user-defined functions.
    u2022If the transformation is very complex, it may be easiest to leverage the power of Java for mapping.
    u2022ABAP mapping programs can also be written to transform the message structures.
    Message Mapping
    SAP XI provides a graphical mapping tool that generates a java mapping program to be called at run time.
    u2022Graphically define mapping rules between source and target message types.
    u2022Queue-based model allows for handling of extremely large documents.
    u2022Drag-and-drop.
    u2022Generates internal Java Code.
    u2022Built-in and user-defined functions (in Java)
    u2022Integrated testing tool.
    u2022N:M mapping is possible.
    JAVA MAPPING:
    Usually Java mapping is preferred when the target structure is relatively complex and the transformation cannot be accomplished by simple graphical mapping.
    For e.g. consider a simple File->IDoc scenarion where the source file is a simple XML file, whereas the target file is an IDoc with more than one hierarchy level e.g FINSTA01. Content conversion in XI can only create a single level hierarchy, so in this scenario a Java mapping would come in handy.
    See these:
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10dd67dd-a42b-2a10-2785-91c40ee56c0b
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
    /people/thorsten.nordholmsbirk/blog/2006/08/10/using-jaxp-to-both-parse-and-emit-xml-in-xi-java-mapping-programs
    When to use Java mapping
    1) Java mapping are used when graphical mapping cannot help you.
    Advantages of Java Mapping
    1)you can use Java APIs and Classes in it.
    2) file look up or a DB lookup is possible
    3) DOM is easier to use with lots of classes to help you create nodes and elements.
    Java mapping can be used when you have complex mapping structures.
    ABAP MAPPING:
    ABAP mappings are mapping programs in ABAP objects that customers can implement using the ABAP Workbench.
    An ABAP mapping comprises an ABAP class that implements the interface IF_MAPPING in the package SAI_MAPPING. The interface has a method EXECUTE with the some signature.
    Applications can decide themselves in the method EXECUTE how to import and change the source XML document. If you want to use the XSLT processor of SAP Web AS, you can use the ABAP Workbench to develop a stylesheet directly rather than using ABAP mappings.
    In ABAP mapping you can read access message header fields. To do this, an object of type IF_MAPPING_PARAM is transferred to the EXECUTE method. The interface has constants for the names of the available parameters and a method GET, which returns the respective value for the parameter name. The constants are the same as in Java mappings, although the constant MAPPING_TRACE does not exist for ABAP mappings. Instead, the trace object is transferred directly using the parameter TRACE of the method IF_MAPPING~EXECUTE.
    For more details refer
    http://help.sap.com/saphelp_nw70/helpdata/EN/ba/e18b1a0fc14f1faf884ae50cece51b/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e3ead790-0201-0010-64bb-9e4d67a466b4
    /people/sameer.shadab/blog/2005/09/29/testing-abap-mapping
    ABAP Mapping
    /people/udo.martens/blog/2006/08/23/comparing-performance-of-mapping-programs
    https://websmp101.sap-ag.de/~sapdownload/011000358700003082332004E/HowToABAPMapping.pdf
    /people/ravikumar.allampallam/blog/2005/02/10/different-types-of-mapping-in-xi
    /people/r.eijpe/blog
    ABAP Mapping Vs Java Mapping.
    Re: Message Mapping of type ABAP Class not being shown
    Re: Performance of mappings (JAVA, XSLT, ABAP)
    XSLT Mapping
    XSLT stands for EXtensible Stylesheet Language Transformations. It is an XML based language for transforming XML documents into any other formats suitable for browser to display, on the basis of set of well-defined rules.
    /people/sap.user72/blog/2005/03/15/using-xslt-mapping-in-a-ccbpm-scenario
    /people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping
    The above menotined are the mapping present in the XI.
    When it is critical and complicate we go for the ABAP,JAVA or XSLt mapping. For simple Mapping we go for the graphical mapping.
    the selection of mapping also depends upon the requirement and alos on our scenario.
    cheers

  • I am trying to open some *.avi files in quicktime, they are from my security camera at home.  It will not open them, would anyone be able to help me?  It says I need a plugin but it does not tell me which one.

    I am trying to open some *.avi files in quicktime, they are from my security camera at home.  It will not open them, would anyone be able to help me?  It says I need a plugin but it does not tell me which one.

    I am trying to open some *.avi files in quicktime, they are from my security camera at home.  It will not open them, would anyone be able to help me?  It says I need a plugin but it does not tell me which one.
    Basically your player is telling you that you need to install the codecs that will play the compressed data within the AVI file.
    AVI is a legacy file container in which the tracks of data are interleaved to maintain synchronization. This data can be encoded using many different audio and video codecs. Your problem is to determine which codecs you need for the player you are trying to use and install them if they are available. Failing that, your will either have to play the files in a different player which has the codec support your require built into the app or convert the content to a compression format that is natively compatible with the player you wish to use.
    Since you have not stated what platform, operating system, and particular player you are targeting for playback, it is difficult to provide precise instructions for fixing your specific problem at this point. Suggest you try alternative players compatible with your system and platform to see if they will play the files, use a dedicated media information utility to determine the codecs needed for playback, or post a sample file for analysis.

  • I have macbook 5.2 and i am using Mac OS 10.5.8 . which one is good for me to upgrade and how to do that..plz help me

    i have macbook 5.2 and i am using Mac OS 10.5.8 . which one is good for me to upgrade and how to do that..plz help me

    You have a 13" Early or Mid 2009 MacBook. Either one can run OS X Mavericks with enough RAM, 2 GB minimum. But first you will need to update to OS X Snow Leopard 10.6.8 so that you have the Mac App Store installed on your MacBook
    Buy this from apple;
    http://store.apple.com/us/product/MC573/mac-os-x-106-snow-leopard
    Then download and update with this update combo;
    OS X Snow Leopard 10.6.8 v1.1 update combo
    http://support.apple.com/kb/DL1399
    After this you will have the Mac App Store on your MacBook and you should be able to download and install OS X Mavericks for free!
    Your MacBook must meet these minimum tech specs to run Mavericks;
    http://support.apple.com/kb/HT5842

  • Hi i want to buy External hard disk which supports mac os latest versions upto mavericks, please suggest me which one is best.

    Hi i want to buy External hard disk which supports mac os latest versions upto mavericks, please suggest me which one is best.

    Check out something like this, I have a couple and they have great. Get the amount of storage that you will need.
    http://eshop.macsales.com/shop/firewire/1394/USB/EliteAL/eSATA_FW800_FW400_USB

  • Could you please tell me, which oracle commands can get below result?

    Could you please tell me, which oracle commands can get below result?
    1. Total size of archive generated
    TotalArchive (GB) Date
    24.415 28-02-2013
    14.223 29-03-2013
    12.133 30-02-2013
    2. Total number of archive logs generated
    COUNT(SEQUENCE#) TO_CHAR
    123 28-03-13
    234 29-03-13
    124 30-03-13

    997398 wrote:
    Could you please tell me, which oracle commands can get below result?
    1. Total size of archive generated
    TotalArchive (GB) Date
    24.415 28-02-2013
    14.223 29-03-2013
    12.133 30-02-2013
    2. Total number of archive logs generated
    COUNT(SEQUENCE#) TO_CHAR
    123 28-03-13
    234 29-03-13
    124 30-03-13query V$LOG

  • Could you please suggest me which version is good and Why?

    I have same program but names different, but with different selects and different logic ( for perfromance tuning). I mean below three resembles to same program took different timings in se30:
    Which one is the BEST ;
    Program  YKRAR232 took :
      ABAP                                                 1,875,565  =  54.1%
      Database                                                 1,479,609  =  42.6%
        System                                                   114,485  =   3.3%
                                                                  3,469,659  = 100,0%
    Program ZKRAR232 took :
         ABAP                                                   482,858  =  12.5%
    Database                                                 3,303,617  =  85.7%
       System                                                    66,941  =   1.7%
                                                                    3,853,416  = 100,0%
    Program YJV_ZKRAR232 took :
         ABAP                                                   529,327  =  32.5%
    Database                                                 1,004,661  =  61.7%
       System                                                    94,538  =   5.8%
                                                                   1,628,526  = 100,0%
    THANKS IN ADVANCE

    Because of the buffering issue, it's difficult to give a good answer. If you just look at run times of database selects, you have to leave enough time between runs for the buffers to be refreshed. Instead, you might want to use transaction ST05 (performance analysis). You can use the explain function on each select to see how efficient (or not) it is. The results returned are calculated by the database and buffering is not an issue. But it may be difficult to compare differnt programs because you may end up trying to compare a lot of selects using a little time each against another larger select that takes longer.
    For strictly ABAP processing, this isn't a problem.
    What I would do is run each program a number of times one after the other and compare programs based on the least run time of each.
    Performance tuning is as much art as science and there are other things to consider as well. For example, a highly tuned program will likely have more code and be more difficult to read and maintain. If the performance savings aren't that great, I would go with the simple program.
    Rob

  • Please tell me, which is better either BASE64 or Quoted-Printable.

    Hello all.
    Does anyone tell me, Which is better on MIME either BASE64 or Quoted-Printable?
    I'm not so familiar with MIME.
    Any Opinion will be appreciated.
    Thanks.
    p.s.
    excuse me for my english.

    BASE64 is better for encoding a binary file, such as gifs, etc...
    Quoted-printable is better for ASCII files with some extra chars, such as newlines, =, $, etc..., this algorithm encode only that chars, leaving all other chars unchanged..
    look at http://pages.prodigy.net/michael_santovec/decode.htm for further information

  • T60 Motherboard replacement. Can anyone tell me which one do i need?

    Hi everyone, i have a probem where my T60 will not work of the battery, i have purchased a new one but still the same, if i try ti power it on using batterythen battery led and charging led flashes very quickly and i can not turn it off, i have to take the battery out. My T60 however works just fine on AC and does charge the battery, after reading a lot on forums i have came to conlusion that my motherboard is faulty. Can any help me to find out which one do i need as i saw there are quite a few options to choose from.
    my T60 is type 2008-CTO and product ID 2008VKF with ATI radeon x1400 with 128mb dedicated graphics
    Thank you in advance!

    Welcome to the Forum!
    These are the original specs. your T60 left the factory with:
    ThinkPad T60 (2008-VKF)             
    Based on 2008-CTO: T2400(1.83GHz), 1GB RAM, 40GB 5400rpm HD, 14.1in 1400x1050 LCD, 128MB ATI Radeon X1400, CDRW/DVD, Intel 802.11abg wireless, Modem, 1Gb Ethernet, UltraNav, Secure chip, Fingerprint reader, 6c Li-Ion batt, WinXP Pro
    You have a T60 14.1" standard screen. Check System service parts - ThinkPad T60, T60p standard screen. Any board listed there will work. (14.1" and 15.0" boards are interchangeable). Use the system board FRU's to assist you in your search.  If FRU is not mentioned in the listing then just make sure the board was removed from a 14.1" or 15.0" standard T60 or T60p. Be sure not to purchase one said to have been removed from a 15.4" widescreen model. You can also try to find an entire 14.1" base, which will make for a much easier swap.
    As for graphics, you can choose between Intel 950, ATI x1400 (which you currently have), ATI x1300, or the more powerful ATI FireGL V5200 employed mostly on the T60p models. The boards with more powerful graphics will be more costly.
    Have a great day. (I do not work for Lenovo)

  • Which one is good?

    plz suggest which one to buy and also mention price...
    N72
    N70
    N70 music edition
    thx in adv

    N70 will be cheap also it can be updated to Music Edition
    If you find my post useful then click on
    Kudos!Nokia N96 (v20.050 / RM-247)
    www.shaysoft.net | Competitions!

  • HI, I am new to java.Please tell me which is the latest version of Java

    Is Java SE7 the latest version of Java? Also, please tell me that what advantages it has compared to its previous version.

    0b5fc302-7c76-48af-be15-6146a99280a8 wrote:
    Is Java SE7 the latest version of Java? Also, please tell me that what advantages it has compared to its previous version.
    The Oracle Java download page has the answers to both of those questions.,
    http://www.oracle.com/technetwork/java/javase/downloads/index.html

  • New to mac - do i need antivirus ? if yes which one is good and free?

    also one which check files i would send to windows users for example.
    also are spywares a danger for leopard too ?
    like stealing ccard info etc etc ?
    how can i protect my mac from it ?
    also which is the best program to uninstall apps totally?
    can u please help me also by telling me the name of the fastest video converter
    so i could convert dvd and videos for my iphone.
    many thx
    Message was edited by: anteros27

    Read the following:
    Do You Need Anti-Virus Protection for Your Mac?
    According to Rich Mogull's article, Should Mac Users Run Antivirus Software?,
    "The reality is that today the Mac platform is relatively safe. There are hundreds of thousands of viruses and other malicious software programs floating around for Windows, but less than 200 are known to target the Mac, and many of those are aimed at versions of the Mac OS prior to Mac OS X (and thus have no effect on a modern Mac).
    It's not that Mac OS X is inherently more secure against viruses than current versions of Windows (although it was clearly more secure than Windows prior to XP SP2); the numerous vulnerabilities reported and patched in recent years are just as exploitable as their Windows equivalents. But most security experts agree that malicious software these days is driven by financial incentives, and it's far more profitable to target the most dominant platform."
    Mr. Mogull is a computer security expert. I recommend reading the entire article as it is quite informative.
    For additional information on viruses, trojans, and spyware visit The XLab FAQs and read the FAQs on viruses and spyware.
    Credit card theft is most likely to occur if you use your browser and are not careful to avoid phishing scams or provide a credit card number via email or other unencrypted format. No software can protect you against yourself.
    Uninstalling Software: The Basics
    Most OS X applications are completely self-contained "packages" that can be uninstalled by simply dragging the application to the Trash. Most applications create preference files which are stored in the /Home/Library/Preferences/ folder. Although they do nothing once you delete the associated application, they do take up some disk space. If you want you can located them in the above location and delete them, too.
    Some applications may install an uninstaller program that can be used to remove the application. In some cases the uninstaller may be part of the application's installer, and is invoked by clicking on a Customize button that will appear during the install process.
    Some applications may install components in the /Home/Library/Applications Support/ folder. You can also check there to see if the application has created a folder. You can also delete the folder that's in the Applications Support folder. Again, they don't do anything but take up disk space once the application is trashed.
    Some applications may install a startupitem or a Log In item. Startupitems are usually installed in the /Library/StartupItems/ folder and less often in the /Home/Library/StartupItems/ folder. Log In Items are set in the Accounts preferences. Open System Preferences, click on the Accounts icon, then click on the LogIn Items tab. Locate the item in the list for the application you want to remove and click on the "-" button to delete it from the list.
    If an application installs any other files the best way to track them down is to do a Finder search using the application name or the developer name as the search term.
    There are also several shareware utilities that can uninstall applications:
    AppZapper
    CleanApp
    Yank
    SuperPop
    Uninstaller
    Spring Cleaning
    Look for them at VersionTracker or MacUpdate.
    For more information visit The XLab FAQs and read the FAQ on removing software.
    There are numerous good tools for converting video formats. Look for them at VersionTracker or MacUpdate.

  • I just got an email saying one of my iCloud accounts is full, but didn't tell me which one

    I have a family that uses one iTunes account, but four iCloud accounts (from old mobile me accounts). I got an email on the iTunes account saying one of them was full, which probably means I didn't get one device setup correctly with the common iTunes account for the store, and the individual iCloud account for personal backups, etc
    How can I see which device is registered to the iTunes account for its iCloud (instead of the old mobile me account) without logging into each device?
    Is there any way for me to monitor four separate iCloud accounts (space utilization) to see if anyone needs cleaning up. As the family sysadmin, I don't want to find out later someone's space ran over and they haven't been backup up in months.

    Here are more details. The email that's not working says, "password rejected for security reasons, please sign in to reset password". I've reset the password numerous times (not at once but I wait a couple days to change it) and it's still rejecting each new one. I signed in to iCloud.com and in my Advanced Settings I "Reset Documents and Data". iCloud does not show any of my email devices (I have a Macbook Pro, iPhone & iPad). iCloud says if my devices aren't showing I must be signed in to iOS 8 or OS X which I am. I'm receiving all email except for the one email account. It is a secondary iCloud account, me.com. After doing the resets, restarting my Mac, the email account is STILL telling me I have to reset the password, which is where I'm stuck. Also, my AppleID/iCloud email is a valid gmail account I've been using for 5 years.

Maybe you are looking for

  • Cost center account determination

    Hello All, When I created outbound delivery for a sales order, on the goods movement tab, cost center automatically assigned to the line item. Could you please inform me how the system derive this cost center? Thanks in advance! Best Regards, JHeRo

  • Use of XPATH when Bursting

    Hello, I am working with the Bursting Engine using 5.6.2 and have a couple of issues around XPATH. I have an XML tree similar to the following <RA0830> <LIST_G_C_PAYGROUP> <G_C_PAYGROUP> <C_DESTINATION>WAC.WAC010.BACS.BDT.WORK1(+1)</C_DESTINATION> <C

  • Field response playing Hide & Seek.

    Hi, I am using Acrobat Pro X to create a form.  This was distributed and some of the respondants replied with some problems. Problem 1: Field responses. Respondents replied they filled in every field. But I saw some missing. It was only when I clicke

  • Camera app missing from iPod

    Camera is missing from ipod touch 4G. Finally succumbed and did the Restore, Reset All to Factory Settings, installed OS5 but camera still not there. Also, there 's no Camera in the Restrictions settings. Does someone have an answer for me?

  • Another BORIS MISSING thread.

    Hi, I've been looking at several BORIS MISSING threads trying to find a solution, and have not found a good one yet. Here is my problem: Originally purchased FCP studio 5.0 in 2005. Noticed Boris was missing (never needed it) about a year ago and nev