Solved

Need Desperate help...Stuck badly

Posted on 2008-10-15
3
174 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 500 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
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 shrink a transaction log file down to a reasonable size.
Viewers will learn how the fundamental information of how to create a table.

623 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