mysql - When to use MongoDB or other document oriented database systems?

In NoSQL: If Only It Was That Easy, the author writes about MongoDB: MongoDB is not a key/value store, it’s quite a bit more. It’s definitely not a RDBMS either. I haven’t used MongoDB in production... Read More

SQL Server 2005 implementation of MySQL REPLACE INTO?

This is something that annoys me about MSSQL (rant on my blog). I wish MSSQL supported upsert. @Dillie-O's code is a good way in older SQL versions (+1 vote), but it still is basically two IO operat... Read More

MySQL wait_timeout Variable - GLOBAL vs SESSION

Your session status are set once you start a session, and by default, take the current GLOBAL value. If you disconnected after you did SET @@GLOBAL.wait_timeout=300, then subsequently reconnected, yo... Read More

php - How to change mysql to mysqli?

The first thing to do would probably be to replace every mysql_* function call with its equivalent mysqli_*, at least if you are willing to use the procedural API -- which would be the easier way, co... Read More

sql order by - MySQL - Control which row is returned by a group by

It's called selecting the group-wise maximum of a column. Here are several different approaches for mysql. Here's how I would do it: SELECT * FROM (SELECT id, max(version_id) as version_id FROM table... Read More

MySql: is it possible to 'SUM IF' or to 'COUNT IF'?

You can use a CASE statement: SELECT count(id), SUM(hour) as totHour, SUM(case when kind = 1 then 1 else 0 end) as countKindOne... Read More

How to rearrange MySQL columns?

Modify also works. Have a look: ALTER TABLE foo MODIFY bar bartype AFTER baz;... Read More

virtualenv, mysql-python, pip: anyone know how?

I'm also trying to setup MySQL bindings in a virtualenv. All I had to do was install the package that contains mysql_config. On Ubuntu it's called libmysqlclient-dev. After that I was able to do a (v... Read More

How do I do a bulk insert in mySQL using node.js

Bulk inserts are possible by using nested array, see the github page Nested arrays are turned into grouped lists (for bulk inserts), e.g. [['a', 'b'], ['c', 'd']] turns into ('a', 'b'), ('c', 'd')... Read More

php - What is the difference between MySQL, MySQLi and PDO?

There are (more than) three popular ways to use MySQL from PHP. This outlines some features/differences PHP: Choosing an API: ( DEPRECATED ) The mysql functions are procedural and use manual escapin... Read More