Tag Info

New answers tagged

0

Not an "answer", but steps for debugging... All of these need to agree: tag on HTML character_set_client, _connection, and _results the WP setting (I don't know what is) the CHARACTER SET on the columns of the relevant tables, or if nothing mentioned, then on the table, from which the columns inherit. And the connection user should not be root. If, ...


1

Anytime you'd start getting a col1, col2, col3 in a database design, you "typically" want to consider those columns as rows in another table. (typically, there are always exceptions - doubtful this is the case ;) ) So you have a LEGO_SETs and LEGO_PARTs table already ? Sounds like you have something like this: table: LEGO_SET SET_ID name ... etc .. ...


1

@a1ex07 seems to have the answer, but I'd like to give an explanation why your code was acting up Your first query SELECT * FROM table WHERE product_id = 905 AND (CASE WHEN store_id = 2 THEN store_id = 2 ELSE store_id = 0 END) evaluates as SELECT * FROM table WHERE product_id = 905 AND (CASE WHEN store_id = 2 THEN 1 ELSE 0 END) then evaluates as ...


2

It seems to me the query below should be quite efficient and return desired results (assuming valid store_id is always positive; otherwise, another aggregate function should be used instead of MAX ). SELECT a.* FROM table1 a INNER JOIN ( SELECT MAX(store_id) as store_id FROM table1 WHERE product_id =905 AND store_id IN (0,2) )b ON ...


0

I think the question is about how to restore faster from mysqldump's ceated dump files and not a different backup solution. One of the ways, you can do this is by creating groups of tables in your schema and create a separate DB user for each group and use MySQL permissions to not allow tables to be inserted to using all but one DB user. This is a proven, ...



Top 50 recent answers are included