473,396 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

mysql problem

I have no access to any Mysql Newsgroup, so I ask here.

I've the same query executed many times and sometimes it returns all results
(117 in my case) and sometimes it returns nothing.
THE QUERY DOESN'T CHANGE, nor the datas in the database.

On my pc it's OK (always returns 117 results) even on phpmyadmin it returns
the 117 records found.
On my ISP, the result is always 0 results, even if it shows 117 results.
Here is the query (I know, not so simple, but I took an existing database)

(SELECT Code, t.name, m.Name, t.idb,t.ids, prt , F.t, puiss, B.t, dst, den
from t INNER JOIN m ON t.idm = m.idm
INNER JOIN mk ON m.idmk = mk.idmk
INNER JOIN t as F ON t.idf = F.id
INNER JOIN t as B on t.idb = B.id
WHERE mk.id = 'A12D'
AND (m.ID = 15)
AND (200001 >= dst AND (den = '' or 199905 <= den))
AND F.l = 'b'
AND B.l = 'b')
UNION
(SELECT st.code, st.name, COALESCE(m.Name, sm.Name), st.idb, st.ids, st.prt,
F.t, st.puiss, B.t, stdst, stden
FROM st
LEFT JOIN sm ON st.idm = sm.idm
LEFT JOIN m ON st.idm = m.idm
LEFT JOIN smk ON sm.idsmk = smk.idsmk
LEFT JOIN mk ON m.idmk = mk.idmk
LEFT JOIN mk AS mk1 ON sm.idmk = mk1.idmk
LEFT JOIN t as F ON st.idf = F.id
LEFT JOIN t as B on st.idb = B.id
WHERE (m.ID = 15 or st.ID = 15 or sm.ID = 15)
AND ((stdst is null or '2000-01-01' >= stdst) AND (sten is null or '199905'
= sten))

AND F.l = 'b' AND B.l = 'b')

Any idea why sometimes I get all results, other nothing.
Changing the query for having results in the second select (after the
UNION), I get sometimes only the result of the 2nd part instead
So sometimes I get the results from the first part, sometimes not. From the
second part I aways get results.

Bob
Sep 23 '05 #1
1 1207
Forget about the looooong query. I've simplified it in order to eliminate
all possible error source.

Here is the simplest query that fails sometimes:

SELECT *
FROM type
INNER JOIN mod ON type.modcode = mod.modcode
INNER JOIN mak ON mod.makecode = mak.makecode

this query works
SELECT *
FROM type
INNER JOIN mod ON type.modcode = mod.modcode

So it seems that as soon as you put 2 inner joins with a table named "type"
then it fails: sometimes I get records, sometimes not.
with query results, the result count is 0-0 (1 total) (in phpmyadmin)

any idea ?
Sep 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: JL | last post by:
Platform: Linux Red Hat RHEL 3 (and red hat 9) Installed MySQL from source. As a matter of fact, installed all LAMPS from source, and the mysql socket file was arranged in a place other than...
0
by: Lenz Grimmer | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, MySQL 4.0.14, a new version of the popular Open Source/Free Software Database, has been released. It is now available in source and binary...
3
by: Kirk Soodhalter | last post by:
Hi, This started as a phpmyadmin problem, but has somehow morphed into a mysql problem. I don't know how to fix it. I am posting the conversation from a php newsgroup since it started there. ...
0
by: Plymouth Acclaim | last post by:
Hi guys, We have a problem with Dual AMD64 Opteron/MySQL 4.0.18/Mandrake 10 for a very high volume site. We are evaluating the performance on our new server AMD64 and it seems it's slow compared...
1
by: Alex Hunsley | last post by:
I am trying to install the DBD::mysql perl module. However, it claims I need mysql.h: cpan> install DBD::mysql CPAN: Storable loaded ok Going to read /home/alex/.cpan/Metadata Database was...
1
by: smsabu2002 | last post by:
Hi, I am facing the build problem while installing the DBD-MySql perl module (ver 2.9008) using both GCC and CC compilers in HP-UX machine. For the Build using GCC, the compiler error is...
1
by: jrs_14618 | last post by:
Hello All, This post is essentially a reply a previous post/thread here on this mailing.database.myodbc group titled: MySQL 4.0, FULL-TEXT Indexing and Search Arabic Data, Unicode I was...
110
by: alf | last post by:
Hi, is it possible that due to OS crash or mysql itself crash or some e.g. SCSI failure to lose all the data stored in the table (let's say million of 1KB rows). In other words what is the worst...
39
by: alex | last post by:
I've converted a latin1 database I have to utf8. The process has been: # mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore --skip-set-charset mydb mydb.sql # iconv -f...
10
by: Caffeneide | last post by:
I'm using a php script which performs three xml queries to other three servers to retrieve a set of ids and after I do a query to mysql of the kind SELECT * FROM table WHERE id IN ('set of ids');...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.