Solved

Need Desperate help...Stuck badly

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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Suggested Solutions

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

862 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now