Ubuntu怎样安装Drush

admin 提交于 周一, 05/18/2015 - 10:07

 

apt-get update

apt-get install curl

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

ln -s /usr/local/bin/composer /usr/bin/composer

composer global require drush/drush:dev-master

apt-get install git

git clone https://github.com/drush-ops/drush.git /usr/local/src/drush

mv /usr/bin/drush /usr/bin/drush.old

ln -s /usr/local/src/drush/drush /usr/bin/drush

cd /usr/local/src/drush

composer install

标签

RANKING IN MYSQL RESULTS

admin 提交于 周四, 05/14/2015 - 10:18

A friend of me asked me long time ago: "How can I have a ranking on a result with MySQL?". Now I found some time to write it down:

Lets do first some preparation for the example:

CREATE TABLE sales (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
, fruit VARCHAR(32)
, amount DECIMAL
);

INSERT INTO sales
VALUES (NULL, 'apple', 12.75), (NULL, 'orange', 1.89), (NULL, 'pear', 19.23)
, (NULL, 'banana', 4.25), (NULL, 'cherry', 123.75), (NULL, 'plum', 23.15)
;

Now lets query:

标签