Hi there,
I would like to know what is missing in the select instruction below because
is repeating 3 times each record. I tried to use
DDepen CROSS JOIN HT_DBAU001_DCliente and that was worst because brought me
much more rows repeated!!!
Thanks,
VILMAR
BRAZIL
SELECT distinct DDepen.DPCliente, DDepen.DPNome, DDepen.DPEmail,
DDepen.DPSenha, HT_DBAU001_DCliente.CLSITU
FROM DDepen,HT_DBAU001_DCliente
WHERE (DDepen.DPCliente BETWEEN 1 AND 4) AND (HT_DBAU001_DCliente.CLSITU
BETWEEN 8 AND 10)
ORDER BY DDepen.DPCliente, DDepen.DPNome
Brings me this:
DPCliente DPNome DPEmail
DPSenha CLSITU
-- --- --
-- -- --
--
1 José jr@.XXX.com.br
00000 8.0
1 José jr@.XXX.com.br
00000 9.0
1 José jr@.XXX.com.br
00000 10.0
3 Marinho
lider@.XXX.com.br 00000 8.0
3 Marinho
lider@.XXX.com.br 00000 9.0
3 Marinho
lider@.XXX.com.br 00000 10.0
(6 row(s) affected)Difficult to explain in a short email but do a google on 'cartesian product'
or 'cross join'. Also, review this in BOL:
Using Cross Joins
A cross join that does not have a WHERE clause produces the Cartesian
product of the tables involved in the join. The size of a Cartesian product
result set is the number of rows in the first table multiplied by the number
of rows in the second table. This is an example of a Transact-SQL cross
join:
Your query joins two tables together but the join does not describe how
those tables are related.
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"news.microsoft.com" <suporte@.hitecnet.com.br> wrote in message
news:ORnEdJ$vDHA.2508@.TK2MSFTNGP12.phx.gbl...
> Hi there,
> I would like to know what is missing in the select instruction below
because
> is repeating 3 times each record. I tried to use
> DDepen CROSS JOIN HT_DBAU001_DCliente and that was worst because brought
me
> much more rows repeated!!!
> Thanks,
> VILMAR
> BRAZIL
> SELECT distinct DDepen.DPCliente, DDepen.DPNome, DDepen.DPEmail,
> DDepen.DPSenha, HT_DBAU001_DCliente.CLSITU
> FROM DDepen,HT_DBAU001_DCliente
> WHERE (DDepen.DPCliente BETWEEN 1 AND 4) AND
(HT_DBAU001_DCliente.CLSITU
> BETWEEN 8 AND 10)
> ORDER BY DDepen.DPCliente, DDepen.DPNome
> Brings me this:
> DPCliente DPNome DPEmail
> DPSenha CLSITU
> -- --- --
--
> -- -- --
--
> --
> 1 José
jr@.XXX.com.br
> 00000 8.0
> 1 José
jr@.XXX.com.br
> 00000 9.0
> 1 José
jr@.XXX.com.br
> 00000 10.0
> 3 Marinho
> lider@.XXX.com.br 00000 8.0
> 3 Marinho
> lider@.XXX.com.br 00000 9.0
> 3 Marinho
> lider@.XXX.com.br 00000 10.0
> (6 row(s) affected)
>
Showing posts with label below. Show all posts
Showing posts with label below. Show all posts
Wednesday, March 21, 2012
Tuesday, March 20, 2012
Question about FullText Search
Hi eveyone,
I have a fullText catalog for a very simple table with 3 rows which contains text like below:
Row 1==> First term, Second term 4-3/16" third term 14.75 forth term 998 3-3/8" 8911 8
Row 2==> First term, Second term 5-3/16" third term 14.95 forth term 11
Row 3==> First term, Second terms 2/18" third term 14.07 forth term 3-3/8" 3
When I try to run query:
1. Select * from myFullText where contains(Text, '3/16') return row 1 and 2 ( ok )
2. Select * from myFullText where contains(Text, '11-3/8') ==> return row 2 (matching 11 only)
3. Select * from myFullText where contains(Text, '3-3/8') return no record
4. Select * from myFullText where contains(Text, '3/8') return no record
If someone do understand about Microsoft FullText search, please help me by explain to me why the output for sql #2, 3 and 4 are like that.
Regards,
John Dang
FYI,
Currently I am using SqlServer 2005, english language and Window XP Pro OS.
JDang
|||Workaround:
Add more keywords:
3-3/8 + 3/8 + 3-3 + 3 + 338 ...
Consider to eliminate slashes and dashes
Make sure that noisewords do not disdurb. ( I dont know enough about when they are used )
Thomas Boffo
Question about FullText Search
Hi eveyone,
I have a fullText catalog for a very simple table with 3 rows which contains text like below:
Row 1==> First term, Second term 4-3/16" third term 14.75 forth term 998 3-3/8" 8911 8
Row 2==> First term, Second term 5-3/16" third term 14.95 forth term 11
Row 3==> First term, Second terms 2/18" third term 14.07 forth term 3-3/8" 3
When I try to run query:
1. Select * from myFullText where contains(Text, '3/16') return row 1 and 2 ( ok )
2. Select * from myFullText where contains(Text, '11-3/8') ==> return row 2 (matching 11 only)
3. Select * from myFullText where contains(Text, '3-3/8') return no record
4. Select * from myFullText where contains(Text, '3/8') return no record
If someone do understand about Microsoft FullText search, please help me by explain to me why the output for sql #2, 3 and 4 are like that.
Regards,
John Dang
FYI,
Currently I am using SqlServer 2005, english language and Window XP Pro OS.
JDang
|||Workaround:
Add more keywords:
3-3/8 + 3/8 + 3-3 + 3 + 338 ...
Consider to eliminate slashes and dashes
Make sure that noisewords do not disdurb. ( I dont know enough about when they are used )
Thomas Boffo
Subscribe to:
Posts (Atom)