Re: [SQL] Odd query behavior

2010-03-12 Thread Tom Lane
"Dan McFadyen" writes: > I've come across an odd situation. I've had access to a database where a > the following happens: What are the plans for the two queries? If either one involves use of an index, does disabling the index change the results? > I do know that server it was running on was F

Re: [SQL] Odd query behavior

2010-03-12 Thread Rob Sargent
Any views involved, or separate users/roles? On 03/12/2010 08:41 AM, Dan McFadyen wrote: > Hello, > > > > I've come across an odd situation. I've had access to a database where a > the following happens: > > > > " SELECT * FROM table WHERE name LIKE 'abc%' "returns 2 rows... > > >

[SQL] Odd query behavior

2010-03-12 Thread Dan McFadyen
Hello, I've come across an odd situation. I've had access to a database where a the following happens: " SELECT * FROM table WHERE name LIKE 'abc%' "returns 2 rows... but... " SELECT * FROM table WHERE name IN (SELECT name FROM table WHERE name LIKE 'abc%') " returns 0 rows...

Re: [SQL] Clarification With Money data type

2010-03-12 Thread Ireneusz Pluta
it's better to use some sort of numeric or integer and store amounts of cents, not dollars.