Do you have a question? Post it now! No Registration Necessary. Now with pictures!
October 23, 2008, 5:33 pm
rate this thread
I have a query here that gives the right results in SQL Management
Studio but wrong results in PHP (using mssql libraries under FreeBSD
The query is as follow:
SELECT ROW_NUMBER() OVER (ORDER BY count DESC), s.*
SELECT ROW_NUMBER() OVER (ORDER BY t.field1), t.blah, ....,
(SELECT COUNT(field2) FROM x WHERE x.fieldx=t.fieldx) AS count
FROM table t
WHERE CONTAINS(t.field3,'"some stuff"')
) AS s
In this query, in management studio the results are the desired
however in PHP, the field count is like incremented and doesn't give
the right results..
count for many records go from 1 1 1 0 0 0 0 ...
count for many records go from 3 3 3 2 2 1 1 0
where it shouldnt be that...
Any idea on that?