Too many results
-
I created a stored procedure in MySQL which returned one row in the result set. Since there is only one row in the table, this it what was supposed to happen. I had to add anouther column to the table, which I did without any problem. Then I modified the SELECT...FROM...WHERE query to include the column, no errors so it should be working correctly. The problem is that now it is returning 25 rows in the result set, all containing the same information. If I add another row to the table, it returns 50 rows - 25 copies of each row in the table. How is that possible?
INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
-
I created a stored procedure in MySQL which returned one row in the result set. Since there is only one row in the table, this it what was supposed to happen. I had to add anouther column to the table, which I did without any problem. Then I modified the SELECT...FROM...WHERE query to include the column, no errors so it should be working correctly. The problem is that now it is returning 25 rows in the result set, all containing the same information. If I add another row to the table, it returns 50 rows - 25 copies of each row in the table. How is that possible?
INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
-
[Message Deleted]
-
[Message Deleted]
**WHERE locations.id = _locationID**
This_locationID
is parameter? If it is not parameter then must be table and u must specify column like :WHERE locations.id = _locationID**.Column**
Also can u add inWHERE
clause columndestiny
with any condition?
I Love T-SQL
-
**WHERE locations.id = _locationID**
This_locationID
is parameter? If it is not parameter then must be table and u must specify column like :WHERE locations.id = _locationID**.Column**
Also can u add inWHERE
clause columndestiny
with any condition?
I Love T-SQL
Sorry I had to delete that mess. The 5 WHERE id compares and 5 SELECT IF() were the cause of the 25 returns - 5 x 5. The solution I came up with was to LEFT JOIN the series of required rows and remove the comparisons from the WHERE.
FROM locations,
loc_staticdata,
loc_staticdata_waters AS sw
LEFT JOIN textures AS d1 ON sw.surfaceTextureID = d1.id
LEFT JOIN textures AS d2 ON sw.shoreTextureID = d2.id
LEFT JOIN textures AS d3 ON sw.envMapOverTextureID = d3.id
LEFT JOIN textures AS d4 ON sw.envMapUnderTextureID = d4.id
LEFT JOIN textures AS d5 ON sw.specularMapTextureID = d5.id
WHERE locations.id = _locationID
AND locations.staticDataID = loc_staticdata.id
AND sw.staticDataID = loc_staticdata.id;I am not sure if it is the best solution, but it works. Thanks for the attempt. :)
INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
-
Sorry I had to delete that mess. The 5 WHERE id compares and 5 SELECT IF() were the cause of the 25 returns - 5 x 5. The solution I came up with was to LEFT JOIN the series of required rows and remove the comparisons from the WHERE.
FROM locations,
loc_staticdata,
loc_staticdata_waters AS sw
LEFT JOIN textures AS d1 ON sw.surfaceTextureID = d1.id
LEFT JOIN textures AS d2 ON sw.shoreTextureID = d2.id
LEFT JOIN textures AS d3 ON sw.envMapOverTextureID = d3.id
LEFT JOIN textures AS d4 ON sw.envMapUnderTextureID = d4.id
LEFT JOIN textures AS d5 ON sw.specularMapTextureID = d5.id
WHERE locations.id = _locationID
AND locations.staticDataID = loc_staticdata.id
AND sw.staticDataID = loc_staticdata.id;I am not sure if it is the best solution, but it works. Thanks for the attempt. :)
INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra