Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2007-03-05 : 10:45:46
|
Ann writes "Ok, I wanted to test my SELECT stmt in SQL Query Analyzer before I put it in prodcution. I place a select stmt to compare the acctnum in one table with the acctnum in another table, but not all of the records come up. I did check the ones that didnt come up from the first file and they were in the second file but it didn't show up. Is there something I am missing. Here is the code I am using: select dbo.scrub_return.acctnum, dbo.scrub_return.found, dbo.bi_prescrub.acctnum from dbo.scrub_return, dbo.bi_prescrub where dbo.scrub_return.acctnum = dbo.bi_prescrub.acctnum and found=' '" |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-03-05 : 11:38:36
|
you want to test it only in QA? That'll be stable use join syntx.well the way you have it written the returned records will be those that have the sameacctnum and dbo.scrub_return.found = ' 'is that what you want??Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
|
|
aboltz
Starting Member
1 Post |
Posted - 2007-03-05 : 15:04:03
|
spirit 1: Yes, that is what I want. Whatever the acctnum is in scrub_return to find it in the bi_prescrub table. I have tried the join syntx but received the same number of acctnums returned. Is there a way to put after dbo.scrub_return.acctnum or dbo.bi_prescrub, which would mean to get everything after in the acctnum field to make sure there is no ambigious characters or such. |
|
|
JohnH
Starting Member
13 Posts |
Posted - 2007-03-06 : 15:56:51
|
I'm having a hard time understanding what you want to accomplish. Can you try asking the question another way?John Hopkins |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-03-06 : 16:52:39
|
try removing the found = '' clause ?select dbo.scrub_return.acctnum, dbo.scrub_return.found, dbo.bi_prescrub.acctnumfrom dbo.scrub_return inner join dbo.bi_prescrubon dbo.scrub_return.acctnum = dbo.bi_prescrub.acctnum where found =' ' KH |
|
|
|
|
|