Solved

Need Desperate help...Stuck badly

Posted on 2008-10-15
3
170 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
  • 2
3 Comments
 
LVL 142

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

773 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