Re: Another cry for help..

2007-12-22 Thread Anders Norrbring
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

Another cry for help..

2007-12-20 Thread Anders Norrbring
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

Re: Another cry for help..

2007-12-20 Thread Anders Norrbring
, 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

Re: Another cry for help..

2007-12-20 Thread Anders Norrbring
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

Re: Another cry for help..

2007-12-20 Thread Anders Norrbring
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

Re: Another cry for help..

2007-12-20 Thread Anders Norrbring
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

Query help, please..

2007-12-11 Thread Anders Norrbring
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

Help with query...

2007-10-14 Thread Anders Norrbring
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 =

SV: Help with query...

2007-10-14 Thread Anders Norrbring
.. ;) 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

User quotas, how?

2004-01-13 Thread Anders Norrbring
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

User quotas, how?

2004-01-12 Thread Anders Norrbring
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

RE: Send someone a database

2003-11-28 Thread Anders Norrbring
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]

Cronjob / rights problem.

2003-11-07 Thread Anders Norrbring
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

Cronjob / rights problem - 2:nd try.

2003-11-07 Thread Anders Norrbring
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