stephan.gerlach
08-26-2009, 06:38 AM
Hi there,
At my work we are running a custom written CRM system. Once a while the MySQL database seems to lock up. I suspect that there is a problem with the search for addresses.
This is the query that gets generated.
SELECT DISTINCT client.id as companyid,
client.company_name,
client.address,
client.postcode
FROM sites,
client
WHERE ( client.address LIKE "%lincolnshire%"
OR (sites.address LIKE "%lincolnshire%"
AND sites.client=client.id
AND sites.deleted=0
)
)
AND client.type>-1
GROUP BY client.id
ORDER BY client.company_name ASC, client.id ASC
can anyone see anything dubious in this query?
Thanks for any help
At my work we are running a custom written CRM system. Once a while the MySQL database seems to lock up. I suspect that there is a problem with the search for addresses.
This is the query that gets generated.
SELECT DISTINCT client.id as companyid,
client.company_name,
client.address,
client.postcode
FROM sites,
client
WHERE ( client.address LIKE "%lincolnshire%"
OR (sites.address LIKE "%lincolnshire%"
AND sites.client=client.id
AND sites.deleted=0
)
)
AND client.type>-1
GROUP BY client.id
ORDER BY client.company_name ASC, client.id ASC
can anyone see anything dubious in this query?
Thanks for any help