Find avg price between two tables but the problem is I can't use join between two tables

  • Hi, if any body can u help me with this problem

  • Need a teeny bit more info...

    ---------------------------------------------
    If data can screw you, it will; never assume the data are correct.

  • kinda brief on the details, aren't you?

    I think the real issue is you KNOW there is a relationship between the two tables, but don't know how to join them? does that sound right?

    help us help you: show us the CREATE TABLE statements, what field it is you want to AVERAGE, and what query you've tried so far.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Then use the 3rd table (articles).

    You can also do this in 2-3 steps (avg on tbl1, avg on tbl2, then join on article and scan for what you need)

  • I joined two tables but the problem is I want to join another table to this there is no any relation like match rows between these tables.

  • vasamsettipradeep (5/3/2011)


    I joined two tables but the problem is I want to join another table to this there is no any relation like match rows between these tables.

    With no relation you use a CROSS JOIN, or you manufacture a relation to use in the ON clause.

    You can see the data and the structure, we can't. It's very difficult to help you in a scenario like this, because you're giving us very little to work with and it's a guessing game instead of something useful. Remember we're all volunteers here, we decide what we want to work on/help with.

    If you need more then this, you're going to have to provide more information. A LOT more. Check out the first link in my sig for an idea, but you're going to have to walk us through the data and the expectations step by step, and explain exactly where you're having difficulty.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply