Anders Norrbring skrev:
Brent,
you put me on the right track.. ;) Reading up a bit on syntax for
variables, I came up with the following, which seems to work.
SET @tid:=(SELECT tid FROM objects WHERE shortname = %s);
SET @vid:=(SELECT vid FROM itemtypes WHERE itemtype LIKE %s);
SELECT (count
Hi.. I'm struggling with a query that I'm trying to simplify as much as
possible, but I can't seem to get rid of using the very same subqueries
several times.
Would there be a way to optimize the following so I get rid of
subqueries that do the exact same thing more than once?
SELECT
, I am escaping the strings in sprintf in PHP, so the %s isn't an issue.
Can't it be done without temporary tables?
On Dec 20, 2007 4:23 PM, Anders Norrbring [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
Hi.. I'm struggling with a query that I'm trying to simplify as much
glance, it doesn't work at all, I get NULL results from it,
but I haven't spent any time trying to locate the problem yet..
So, I'm still open for ideas!
On 12/20/07, Anders Norrbring [EMAIL PROTECTED] wrote:
Hi.. I'm struggling with a query that I'm trying to simplify as much as
possible
seems to do it..
Anders
Anders Norrbring skrev:
Brent Baisley skrev:
You might be able to use variables to store the result of the query.
Although I've never tried assigning the result of a query to a
variable, only field values.
SELECT (count(*)+)/(SELECT COUNT(*) FROM score AS s2
WHERE s2.tid
better, or at least put you on a better track.
I haven't checked this yet, but would it be better/smoother than putting
the variables assignments in separate SET statements in front of the
SELECT as I mentioned?
Anders
On 12/20/07, Anders Norrbring [EMAIL PROTECTED] wrote:
Brent Baisley
I'm looking at a situation I haven't run into before, and I'm a bit
puzzled by it.
I have this table structure:
Table USERS: userid, class
Table OBJECT: userid, class, result
Now I want to query the database for a certain user's result in a
specified class, which is very, very easy. No
I'm trying to set up a query, but I don't really get the result I
expected, so can someone please help me out here?
The query I've built is this:
SELECT a1.username FROM accountuser AS a1
LEFT JOIN (freeaccounts AS f1, payments AS p1)
ON (a1.username = p1.username
AND p1.username =
.. ;)
Anders.
- Original Message -
From: Anders Norrbring [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Sunday, October 14, 2007 7:13 AM
Subject: Help with query...
I'm trying to set up a query, but I don't really get the result I
expected, so can someone please help me out here
Hiya all!
I'm curious about if there's a simple way to manage user quotas in a MySQL
database? F.x. user one can have 10MB data in the database and user two can
have a maximum of 5MB?
Anders Norrbring
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
Hiya all!
I'm curious about if there's a simple way to manage user quotas in a MySQL
database? F.x. user one can have 10MB data in the database and user two can
have a maximum of 5MB?
Anders Norrbring
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
HOST.DOMAIN.XXX -p DATABASE_TABLE the_database.sql
Anders Norrbring
Norrbring Consulting
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
here? If the /usr/bin/mysqladmin tries to
use a user from localhost (any) then it fails, because localhost doesn't
have access to the SQL server... What user should be granted access (and
from where) to make this job work correctly?
Anders Norrbring
Norrbring Consulting
Halmvägen 42
SE-691 48
correctly?
Anders Norrbring
Norrbring Consulting
Halmvägen 42
SE-691 48 Karlskoga
SWEDEN
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
--
MySQL General Mailing List
For list archives: http://lists.mysql.com
14 matches
Mail list logo