Commit 0870803d authored by cividesk's avatar cividesk

Change format of contacts-range query

parent c182a32a
......@@ -65,6 +65,57 @@ INSERT INTO `common_language` (`iso`, `language`) VALUES
('lt', 'Lithuanian'),
('ca', 'Catalan');
--
-- Table structure for table `common_contactrange`
--
DROP TABLE IF EXISTS `common_contactrange`;
CREATE TABLE IF NOT EXISTS `common_contactrange` (
`range` varchar(20) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
`low` int(8) NOT NULL,
`high` int(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `common_contactrange`
--
INSERT INTO `common_contactrange` (`range`, `low`, `high`) VALUES
('less than 250', 0, 250),
('250 to 1,000', 250, 1000),
('1,000 to 2,500', 1000, 2500),
('2,500 to 10,000', 2500, 10000),
('10,000 to 25,000', 10000, 25000),
('25,000 to 100,000', 25000, 100000),
('100,000 to 250,000', 100000, 250000),
('250,000 and up', 250000, 90000000);
--
-- Dumping data for table `common_language`
--
INSERT INTO `common_language` (`iso`, `language`) VALUES
('en', 'English'),
('fr', 'French'),
('de', 'German'),
('nl', 'Dutch'),
('es', 'Spanish'),
('it', 'Italian'),
('pt', 'Portuguese'),
('pl', 'Polish'),
('ru', 'Russian'),
('da', 'Danish'),
('hu', 'Hungarian'),
('sv', 'Swedish'),
('nb', 'Norwegian Bokmål'),
('fi', 'Finnish'),
('zh', 'Chinese'),
('el', 'Greek'),
('he', 'Hebrew'),
('ja', 'Japanese'),
('lt', 'Lithuanian'),
('ca', 'Catalan');
--
-- Table structure for table `github_commit`
--
......
......@@ -112,16 +112,10 @@ $queries[] = array(
$queries[] = array(
'file' => 'contacts-range.json',
'query' => "
SELECT
SUM(Contact < 250) AS `0 to 250`,
SUM(Contact BETWEEN 251 AND 1000) AS `250 to 1,000`,
SUM(Contact BETWEEN 1001 AND 2500) AS `1,000 to 2,500`,
SUM(Contact BETWEEN 2501 AND 10000) AS `2,500 to 10,000`,
SUM(Contact BETWEEN 10001 AND 25000) AS `10,000 to 25,000`,
SUM(Contact BETWEEN 25001 AND 100000) AS `25,000 to 100,000`,
SUM(Contact BETWEEN 100000 AND 250000) AS `100,000 to 250,000`,
SUM(Contact > 250000) AS `250,000 and up`
FROM pingback_site
WHERE is_active = 1
SELECT
r.range, (
SELECT SUM(Contact BETWEEN r.low+1 AND r.high) FROM pingback_site WHERE is_active = 1
) AS `count`
FROM common_contactrange r
",
);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment