Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Need Desperate help...Stuck badly

Posted on 2008-10-15
3
Medium Priority
?
176 Views
Last Modified: 2010-03-19
i am running a query in sql server 2005

There are 2 tables one is Table_1 and other is Tabe_5
when i select the terms individually like select trailer_1 from Table_5 with the same condition,
i get 15 rows of data,
but when i introduce the factor of trade_quantity there
i takes all the rows of Table_1(14451 rows) and multiplies them with 15
can you please suggest a solution at the earliest as i have to give this kind of queries by tomorrow morning and i am completely stuck here
code is below
select t1.trade_quantity,t5.trailer_1 from Table_1 t1,Table_5 t5 where ((t5.account_no like '4W7G%') and (t5.trailer_1 like '%5%5'))

Open in new window

0
Comment
Question by:project_dev
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 22726558
how are the rows of the 2 tables related?
there seems no condition set up between the 2, so either you are missing that, or it should actually be a UNION query?
0
 

Author Comment

by:project_dev
ID: 22726592
the two tables are connected through a row_count variable
0
 

Author Comment

by:project_dev
ID: 22726608
thanks dude
your idea just struck me,
i was not comparing the row count of the two.
you saved the day man....
thanks a lot...
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question