Related
i am very new to SQL and have to complete my first ever project. i keep getting errors to do with syntax and i have no idea where i've gone wrong, i've checked for commas, hyphens in the wrong place and feel like i'm going mad. can someone help me please?
the errors:
1. (49, 'Purple Kiss', null, '퍼플키스', '2021-03-15', 'RBW', 7, 7, 'PLORY', true), "null" is not valid at this position, expecting ')'
(again, where is the null coming from?)
2. (37, 'Uni.T', null, '유니티', '2018-05-18', 'Unit Culture', 8, 9, false), extraneous input false found, expecting ')'
(what is an extraneous input?)
3. (26, 'The Ark', null, '디아크', '2015-04-12', 'Music K', 5, 5, null, false),
9 is not valid at this position, expecting ')'
(not sure where the 9 is coming from)
it might be a really simple fix, but again, this is my first project and have no idea what's wrong, please help! i don't know if it's something to do with the korean characters? i read somewhere to use 'NVARCHAR' as the datatype so that's what i used, please explain it to me like i'm a child xD
create database female_kpop_idols;
use female_kpop_idols;
create table kpop_girlgroups
(idol_id int primary key auto_increment not null,
eng_name varchar(50) not null,
short_name varchar(50),
kor_name nvarchar(50) not null,
debut date not null,
company varchar(50) not null,
members int not null,
orig_members int not null,
fanclub varchar(50),
active boolean);
insert into kpop_girlgroups
values
(1, 'Baby V.O.X', null, '베이비복스', '1997-07-05', 'DR Music', 5, 5, null, false),
(2, 'S.E.S', null, '에스.이.에스', '1997-11-01', 'SM', 3, 3, null, false),
(3, 'Fin.K.L', null, '핑클', '1998-05-22', 'DSP', 4, 4, null,
(4, 'Brown Eyed Girls', 'B.E.G', '브라운 아이드 걸스 ', '2006-03-02', 'Mystic', 4, 4, 'Everlasting', true),
(5, 'Wonder Girls', 'WG', '원더걸스', '2007-02-13', 'JYP', 4, 5, 'Wonderful', false),
(6, 'Kara', null, '카라', '2007-03-29', 'DSP', 4, 5, 'Kamilia', false),
(7, 'Girls\' Generation', 'SNSD', '2007-08-05', 'SM', 5, 9, 'SONE', true),
(8, 'After School', null, '애프터스쿨', '2009-01-15', 'Pledis', 6, 5, 'Playgirlz', false),
(9, '2NE1', null, '투애니원', '2009-05-06', 'YG', 3, 4, 'Blackjack', false),
(10, '4Minute', null, '포미닛', '2009-06-15', 'Cube', 5, 5, '4nia', false),
(11, 'T-ara', null, '티아라', '2009-07-29', 'MBK', 4, 6, 'Queen\'s', true), -- hiatus --
(12, 'f(x)', null, '에프엑스', '2009-08-24', 'SM', 4, 5, 'MeU', false),
(13, 'Sistar', null, '씨스타', '2010-03-06', 'Starship', 4, 4, 'STAR1', false),
(14, 'missA', null, '미쓰에이', '2010-07-01', 'JYP', 3, 4, 'Say A', false),
(15, 'Girl\'s Day', 'GsD', '걸스데이', '2010-07-09', 'DreamT', 4, 5, 'Dai5y', true), -- hiatus --
(16, 'Rania', null, '라니아', '2011-04-06', 'DR Music', 5, 8, null, false), -- redebuted as Black Swan --
(17, 'Brave Girls', null, '브레이브걸스', '2011-04-08', 'Brave', 4, 5, null, true),
(18, 'Apink', null, '에이핑크', '2011-04-19', 'Plan A', 6, 7, 'Pink Panda', true),
(19, 'EXID', null, '이엑스아이디', '2012-02-16', 'Yedang', 5, 6, 'LEGO', true),
(20, 'AOA', null, '에이오에이', '2012-07-30', 'FNC', 4, 8, 'ELVIS', true), -- hiatus --
(21, 'Mamamoo', null, '마마무', '2014-06-18', 'RBW', 4, 4, 'Moomoo', true),
(22, 'Red Velevet', 'RV', '레드벨벳', '2014-08-01', 'SM', 5, 4, true),
(23, 'Minx', null, '밍스', '2014-09-18', 'Happy Face', 5, 5, false), -- redebuted as DreamCatcher --
(24, 'Gfriend', null, '여자친구', '2015-01-15', 'Source', 6, 6, 'Buddy', false),
(25, 'CLC', null, '씨엘씨', '2015-03-19', 'Cube', 7, 5, 'Cheshire', false),
(26, 'The Ark', null, '디아크', '2015-04-12', 'Music K', 5, 5, null, false), -- some members redebuted as KHAN --
(27, 'Oh My Girl', 'OHMG', '오마이걸', '2015-04-21', 'WM', 6, 8, 'Miracle', true),
(28, 'TWICE', null, '트와이스', '2015-10-20', 'JYP', '9, '9, 'ONCE', true),
(29, 'WJSN', 'Cosmic Girls', '2016-02-25', 'Starship', 13, 12, 'Ujung', true),
(30, 'IOI', 'I.O.I', '아이오아이', '2016-05-04', 'YMC', 11, 11, null, false),
(31, 'BLACKPINK', null, '블랙핑크', '2016-08-08', 'YG', 4, 4, 'BLINK', true),
(32, 'Momoland', null, '모모랜드', '2016-11-09', 'Duble Kick', 9, 6, true),
(33, 'DreamCatcher', null, '드림캐쳐', '2017-01-13', 'Happy Face', 7, 7, 'InSomnia', true),
(34, 'Pristin', null, '프리스틴', '2017-03-21', 'Pledis', 10, 10, 'HIgh', false), -- some redebuted as Hinapia --
(35, 'fromis_9', null, '프로미스나인', '2018-01-24', 'Pledis', 9, 9, 'Flover', true),
(36, '(G)I-DLE', null, '(여자)아이들', '2018-05-02', 'Cube', 5, 6, 'Neverland', true),
(37, 'Uni.T', null, '유니티', '2018-05-18', 'Unit Culture', 8, 9, false), -- come back to this one and add Sonamoo, SPICA, DIA, April, Dal Shabet, Laboum, The ARK --
(38, 'KHAN', null, '칸', '2018-05-23', 'Maroo', 2, 2, false),
(39, 'Loona', 'LOOΠΔ', '이달의 소녀', '2018-08-20', 'Blockberry', 12, 12, 'Orbit', true),
(40, 'IZ*ONE', 'IZONE', '아이즈원', '2018-10-29', 'Off The Record', 12, 12, 'WIZ*ONE' false),
(41, 'Cherry Bullet', null, '체리블렛', '2019-01-21', 'FNC', 7, 10, 'Lullet', true),
(42, 'ITZY', null, '있지', '2019-02-12', 'JYP', 5, 5, 'MIDZY', true),
(43, 'Everglow', null, '에버글로우 ', '2019-03-18', 'Yuehua', 6, 6, 'Forever', true),
(44, 'Rocket Punch', null, '로켓펀치', '2019-08-07', 'Woollim', 6, 6, 'Ketchy', true),
(45, 'Hinapia', null, '희나피아', '2019-11-03', 'Alseubit', 5, 5, 'UBY', false);
Suppose we have a table in mySQL database where fname has a connection to another fname(BB_Connection_name), we would like have a query to find the pair(s) of friends who find connection among themselves.
E.g
Sidharth and Asim both have each others BBid and BB_Connection_ID
I have looked for similar case of father, son and grandson question but in that not each father has a son and thus inner joining them makes things easier for solving. I tried using that but didn't work.
Here i need to check BB_Connection_ID for every fname(A) and then corresponding fname has A's BBid as his BB_Connection_ID or not.
The pairs which would be chosen, should be like Sidharth<->Asim
We need to find the pairs who have their connection ID to each other.
==========================================================================
Code for recreation of the table:
-----------------------------------------------------------------------------
create table world.bigbb(
BBid int not null auto_increment,
fname varchar(20) NOT NULL,
lname varchar(30),
BBdays int not null,
No_of_Nom int,
BB_rank int not null,
BB_Task varchar(10),
BB_Connection_ID int,
BB_Connection_name varchar(10),
primary key (BBid)
);
insert into world.bigbb (fname, lname, BBdays, No_of_Nom, BB_rank, BB_Task, BB_Connection_ID, BB_Connection_name)
values
('Sidharth', 'Shukla', 40, 4, 2, 'Kitchen', 11, 'Asim'),
('Arhaan', 'Khan', 7, 1, 9, 'Kitchen', 16, 'Rashmi'),
('Vikas', 'Bhau', 7, 1, 8, 'Bedroom', 11, 'Asim'),
('Khesari', 'Bihari', 7, 1, 12, 'Kitchen', 9, 'Paras'),
('Tehseem', 'Poonawala', 7, 1, 11, 'Washroom', 12, 'Khesari'),
('Shehnaaz', 'Gill', 40, 4, 4, 'Washroom', 9, 'Paras'),
('Himanshi', 'Khurana', 7, 0, 7, 'Bedroom', 8, 'Shefali'),
('Shefali', 'Zariwala', 7, 1, 10, 'Bedroom', 1, 'Sidharth'),
('Paras', 'Chabra', 40, 3, 1, 'Bathroom', 10, 'Mahira'),
('Mahira', 'Sharma', 40, 4, 5, 'Kitchen', 9, 'Paras'),
('Asim', 'Khan', 40, 3, 3, 'Bathroom', 1, 'Sidharth'),
('Arti', 'Singh', 40, 5, 6, 'Captain', 1, 'Sidharth'),
('Sidharth', 'Dey', 35, 6, 16, 'None', 14, 'Shefali'),
('Shefali', 'Bagga', 38, 5, 15, 'None', 13, 'Sidharth'),
('Abu', 'Fifi', 22, 5, 17, 'None', 11, 'Asim'),
('Rashmi', 'Desai', 38, 5, 13, 'None', 17, 'Debolina'),
('Debolina', 'Bhattacharjee', 38, 5, 14, 'None', 16, 'Rashmi');
One solution would be to self-join the table:
select
b1.fname name1,
b2.fname name2
from bigbb b1
inner join bigbb b2
on b1.BB_Connection_ID = b2.BBid
and b2.BB_Connection_ID = b1.BBid
and b1.BBid < b2.BBid
This will give you one record for each pair, with the record having the smallest BBid in the first column.
This demo on DB Fiddle with your sample data returns:
name1 | name2
:------- | :-------
Sidharth | Asim
Paras | Mahira
Sidharth | Shefali
Rashmi | Debolina
I need to find sum of specific columns as per matched some of columns value in database table.
Please check mysql table that i use :
CREATE TABLE IF NOT EXISTS `plant_production_items` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`plant_production_id` int(11) NOT NULL,
`materialid` int(11) NOT NULL,
`packaging_id` int(11) NOT NULL,
`grade_id` int(11) NOT NULL,
`slabs` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `material_purchase_id` (`plant_production_id`),
KEY `grade_id` (`grade_id`),
KEY `packaging_id` (`packaging_id`),
KEY `slabs` (`slabs`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=104 ;
Value are as under :
INSERT INTO `plant_production_items` (`id`, `plant_production_id`, `materialid`, `packaging_id`, `grade_id`, `slabs`) VALUES
(5, 4, 22, 85, 29, 4444),
(6, 5, 22, 14, 25, 3234),
(8, 6, 27, 21, 60, 4444),
(11, 8, 22, 85, 29, 44444),
(19, 7, 22, 84, 29, 434),
(75, 10, 26, 0, 51, 1233),
(76, 10, 24, 17, 34, 251),
(78, 10, 26, 0, 46, 3234),
(91, 9, 27, 21, 57, 1000),
(92, 9, 27, 21, 57, 2000),
(93, 3, 23, 16, 32, 5000),
(94, 3, 27, 21, 54, 3233),
(101, 3, 27, 21, 0, 700),
(103, 3, 29, 27, 0, 6666);
I want total sum of 'slabs' columns as per unique value founded in following column :
plant_production_id
materialid
packaging_id
grade_id
In short we need to find combination of all 4 values of above and need to show total sum of 'slabs' column.
For example :
there are two records which are same:
(91, 9, 27, 21, 57, 1000),
(92, 9, 27, 21, 57, 2000),
so here i want to get total sum i.e 1000+2000 = 3000
Out put should be all columns with total slabs. It is not required we need to match all above 4 columns. Actually we need to find all total slabs as per total records found same with above 4 column.
If still not clear then let me know.
You can use GROUP BY like this:
SELECT
plant_production_id,
materialidm,
packaging_id,
grade_id,
SUM(`slabs`) slabs_sum
FROM plant_production_items
GROUP BY plant_production_id, materialidm, packaging_id, grade_id;
So it gives the sum of the slabs for rows with the same values for columns grouped by.
I have removed 'age_range' from this query.
INSERT INTO `filters` (`id`, `user_id`, `profession_preference`, `country`, `city`, `order_by`, `profession_orientation`, `age_range`, `distance_range`, `location_dating`) VALUES
(9, 20, 3, 'All Countries', '', 2, 1, '16,100', '0,500', 0),
(10, 12, 3, 'Egypt', '', 2, 1, '', '', 0),
(11, 19, 3, 'All Countries', '', 2, 1, '16,100', '0,500', 0),
(13, 20, 3, 'All Countries', '', 2, 1, '16,100', '0,500', 0),
(14, 20, 3, 'All Countries', '', 2, 1, '16,100', '0,500', 0),
(15, 20, 3, 'All Countries', '', 2, 1, '16,100', '0,500', 0),
(25, 121, 3, 'All Countries', '', 3, 1, '18,23', '0,500 ', 0),
(26, 316, 3, 'United States', '', 3, 1, '17,25', '0,500', 0);
I executed again and receive this error:
MySQL said: Documentation
#1136 - Column count doesn't match value count at row 1
When you insert a record, it matches the values in the VALUES list to the columns in the columns list by comma-separated position. So, this insert statement:
INSERT INTO `foo` (`A`, `B`, `C`)
VALUES ('valueA', 'valueB', 'valueC')
It will insert valueA into column A, valueB into column B, etc. because they match positions in their respective lists. If you remove B from the columns list and leave VALUES alone, it will not attempt to insert valueA into column A, but valueB into column C because they now match value positions, but it won't know what to do with valueC because there are now more values than columns, so since you removed the column from the second position, you would also need to remove the value from the second position.
So back to your query, you would need to determine which position age_range occupied in the columns list and remove the values from the same position in the values list.
Does that make sense?
You have 9 columns defined in your insert statement and you are trying to insert 10 values. you either need to add another column definition or remove from your values.
According to rule the column name define and provided values count should be same. In your case one column value in extra.
As the documentation says
"Column count doesn't match value count"
You specify 9 columns (id, user_id, profession_preference, country, city, order_by, profession_orientation, distance_range, location_dating) in your insert statement
and you are trying to insert 10 values.
You have to remove one value or add another column
Before removing column this is the script which will work
CREATE TABLE filters (id INT, user_id INT, profession_preference INT, country VARCHAR(50), city VARCHAR(50), order_by INT, profession_orientation INT, age_range VARCHAR(50), distance_range VARCHAR(50), location_dating INT);
INSERT INTO filters (id, user_id, profession_preference, country, city, order_by, profession_orientation, age_range, distance_range, location_dating) VALUES
(9, 20, 3, 'All Countries', '', 2, 1, '16,100', '0,500', 0),
(10, 12, 3, 'Egypt', '', 2, 1, '', '', 0),
(11, 19, 3, 'All Countries', '', 2, 1, '16,100', '0,500', 0),
(13, 20, 3, 'All Countries', '', 2, 1, '16,100', '0,500', 0),
(14, 20, 3, 'All Countries', '', 2, 1, '16,100', '0,500', 0),
(15, 20, 3, 'All Countries', '', 2, 1, '16,100', '0,500', 0),
(25, 121, 3, 'All Countries', '', 3, 1, '18,23', '0,500 ', 0),
(26, 316, 3, 'United States', '', 3, 1, '17,25', '0,500', 0);
Now since you removed age_range column, below script will work:
INSERT INTO filters (id, user_id, profession_preference, country, city, order_by, profession_orientation, distance_range, location_dating) VALUES
(9, 20, 3, 'All Countries', '', 2, 1, '0,500', 0),
(10, 12, 3, 'Egypt', '', 2, 1, '', 0),
(11, 19, 3, 'All Countries', '', 2, 1, '0,500', 0),
(13, 20, 3, 'All Countries', '', 2, 1, '0,500', 0),
(14, 20, 3, 'All Countries', '', 2, 1, '0,500', 0),
(15, 20, 3, 'All Countries', '', 2, 1, '0,500', 0),
(25, 121, 3, 'All Countries', '', 3, 1, '0,500', 0),
(26, 316, 3, 'United States', '', 3, 1, '0,500', 0);
I removed third last column from insert script.
Hope this helps!
I'm trying to make an average list for a bowling club. I have a database with the following tables:
team_medlem (medlem_id, name, address, etc)
team_samling (match_id, lag_id, borta (0 = home game, 1 = away game), date, time, etc)
team_match (id, match_id, s1, s2, etc)
team_resultat (id, medlem_id, results, series, banp, match_id)
I want to get the total average, average home and away average. result is the total points for the entire game for each player and the series is the number of played series.
I have this:
SELECT team_resultat.medlem_id, team_medlem.namn, sum(resultat)/sum(serier) as snitt, sum(banp)
FROM team_resultat
JOIN team_medlem ON team_resultat.medlem_id = team_medlem.medlem_id
JOIN team_samling ON team_resultat.match_id = team_samling.match_id
WHERE datum >= current_date - interval '1' year
GROUP BY namn
ORDER BY snitt desc
How can I get home average and away average?
I have tried this but it miscalculated averages
SELECT team_resultat.medlem_id, team_medlem.namn, sum(resultat)/sum(serier) as snitt, sum(banp), avg(case when not borta then resultat/serier end) as hemmasnitt, avg(case when borta then resultat/serier end) as bortasnitt
FROM team_resultat
JOIN team_medlem ON team_resultat.medlem_id = team_medlem.medlem_id
JOIN team_samling ON team_resultat.match_id = team_samling.match_id
WHERE datum >= current_date - interval '1' year
GROUP BY namn
ORDER BY snitt desc
Sampeldata:
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Värd: 127.0.0.1
-- Tid vid skapande: 03 nov 2014 kl 20:07
-- Serverversion: 5.6.17
-- PHP-version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Databas: `teamet`
--
-- --------------------------------------------------------
--
-- Tabellstruktur `team_medlem`
--
CREATE TABLE IF NOT EXISTS `team_medlem` (
`medlem_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`namn` varchar(100) COLLATE utf8_swedish_ci NOT NULL,
PRIMARY KEY (`medlem_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci COMMENT='Medlems register'AUTO_INCREMENT=36 ;
--
-- Dumpning av Data i tabell `team_medlem`
--
INSERT INTO `team_medlem` (`medlem_id`, `namn`) VALUES
(1, 'Sven-Åke Jansson'),
(2, 'Christer Wendel'),
(4, 'Sören Carlsson'),
(5, 'Jan Ingvarsson'),
(6, 'Lars-Göran Wetterholm'),
(7, 'Anders Svensson'),
(8, 'Bengt Carlsson'),
(9, 'Per-Olof Johansson'),
(10, 'Barsom Calan'),
(11, 'Mikael Mårtensson'),
(12, 'Andreas Johansson'),
(13, 'Jonas Wendel'),
(14, 'Sören Fransson'),
(15, 'Daniel Fransson'),
(16, 'Stefan Lord'),
(18, 'Lennart Johansson'),
(19, 'Jonas Nilsson'),
(20, 'Mikael Nilsson'),
(21, 'Patrik Emanuelsson'),
(22, 'Jörgen Norman'),
(24, 'Anders Johansson'),
(25, 'Andreas Larsson'),
(26, 'Roger Larsson'),
(27, 'Peter Ericson'),
(28, 'Dado Hrnic'),
(29, 'Maria Lord-Johansson'),
(33, 'Mats Wellermark');
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Värd: 127.0.0.1
-- Tid vid skapande: 03 nov 2014 kl 20:13
-- Serverversion: 5.6.17
-- PHP-version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Databas: `teamet`
--
-- --------------------------------------------------------
--
-- Tabellstruktur `team_samling`
--
CREATE TABLE IF NOT EXISTS `team_samling` (
`match_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`lag_id` int(11) DEFAULT NULL,
`omg` int(2) unsigned DEFAULT NULL,
`borta` tinyint(1) unsigned DEFAULT '0',
`datum` date DEFAULT NULL,
`tid` time DEFAULT NULL,
`motstandare` varchar(50) COLLATE utf8_swedish_ci DEFAULT NULL,
`samling` varchar(6) COLLATE utf8_swedish_ci DEFAULT NULL,
`ovrigt` varchar(50) COLLATE utf8_swedish_ci DEFAULT NULL,
PRIMARY KEY (`match_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci COMMENT='Samling' AUTO_INCREMENT=14 ;
--
-- Dumpning av Data i tabell `team_samling`
--
INSERT INTO `team_samling` (`match_id`, `lag_id`, `omg`, `borta`, `datum`, `tid`, `motstandare`, `samling`, `ovrigt`) VALUES
(1, 1, 1, 0, '2014-10-28', '12:15:00', 'Forsheda', '11:30', 'match dräkt'),
(2, 2, 1, 0, '2014-10-27', '10:00:00', 'Jönköping KK', '09:15', ''),
(3, 3, 3, 0, '2014-10-30', '15:20:00', 'Alvesta', '14:30', ''),
(4, 2, 2, 1, '2014-11-05', '12:00:00', 'Sävsjö', '09:15', 'Buss'),
(5, 2, 2, 1, '2014-11-05', '14:00:00', 'Eksjö', NULL, NULL),
(6, 3, 2, 0, '2014-11-06', '11:15:00', 'Jönköping kk', '10:30', NULL),
(11, 1, 20, 1, '2014-11-05', '12:30:00', 'test borta 2', '09:30', NULL),
(13, 1, 22, 0, '2014-11-06', '10:00:00', 'Test hemma', '09:00', NULL);
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Värd: 127.0.0.1
-- Tid vid skapande: 03 nov 2014 kl 20:16
-- Serverversion: 5.6.17
-- PHP-version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Databas: `teamet`
--
-- --------------------------------------------------------
--
-- Tabellstruktur `team_resultat`
--
CREATE TABLE IF NOT EXISTS `team_resultat` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`medlem_id` int(11) unsigned DEFAULT NULL,
`resultat` decimal(5,2) unsigned DEFAULT NULL,
`serier` int(2) unsigned DEFAULT NULL,
`banp` int(1) unsigned DEFAULT NULL,
`match_id` int(11) unsigned DEFAULT NULL,
`resultat_sparad` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci COMMENT='Match resultat' AUTO_INCREMENT=53 ;
--
-- Dumpning av Data i tabell `team_resultat`
--
INSERT INTO `team_resultat` (`id`, `medlem_id`, `resultat`, `serier`, `banp`, `match_id`, `resultat_sparad`) VALUES
(1, 6, '800.00', 4, 3, 2, '2014-10-11 17:11:37'),
(2, 7, '790.00', 4, 3, 2, '2014-10-11 17:11:37'),
(3, 11, '780.00', 4, 2, 2, '2014-10-11 17:11:37'),
(4, 12, '770.00', 4, 2, 2, '2014-10-11 17:11:37'),
(5, 14, '760.00', 4, 3, 2, '2014-10-11 17:11:37'),
(6, 15, '750.00', 4, 2, 2, '2014-10-11 17:11:37'),
(7, 24, '740.00', 4, 2, 2, '2014-10-11 17:11:37'),
(8, 25, '505.00', 3, 1, 2, '2014-10-11 17:11:37'),
(9, 27, '165.00', 1, 0, 2, '2014-10-11 17:11:37'),
(10, 8, '700.00', 4, 2, 1, '2014-10-26 14:29:20'),
(11, 9, '690.00', 4, 3, 1, '2014-10-26 14:29:20'),
(12, 10, '680.00', 4, 2, 1, '2014-10-26 14:29:20'),
(13, 13, '670.00', 4, 2, 1, '2014-10-26 14:29:20'),
(14, 19, '660.00', 4, 2, 1, '2014-10-26 14:29:20'),
(15, 20, '650.00', 4, 1, 1, '2014-10-26 14:29:20'),
(16, 22, '640.00', 4, 2, 1, '2014-10-26 14:29:20'),
(17, 25, '640.00', 4, 1, 1, '2014-10-26 14:29:20'),
(19, 1, '800.00', 4, 2, 3, '2014-10-26 14:31:00'),
(20, 2, '790.00', 4, 2, 3, '2014-10-26 14:31:00'),
(21, 4, '780.00', 4, 2, 3, '2014-10-26 14:31:00'),
(22, 5, '770.00', 4, 2, 3, '2014-10-26 14:31:00'),
(23, 7, '760.00', 4, 2, 3, '2014-10-26 14:31:00'),
(24, 8, '750.00', 4, 2, 3, '2014-10-26 14:31:00'),
(25, 14, '740.00', 4, 3, 3, '2014-10-26 14:31:00'),
(26, 15, '500.00', 3, 1, 3, '2014-10-26 14:31:00'),
(27, 18, '150.00', 1, 1, 3, '2014-10-26 14:31:00'),
(28, 2, '800.00', 4, 2, 4, '2014-10-26 16:57:47'),
(29, 6, '790.00', 4, 2, 4, '2014-10-26 16:57:47'),
(30, 11, '780.00', 4, 2, 4, '2014-10-26 16:57:47'),
(31, 12, '770.00', 4, 2, 4, '2014-10-26 16:57:47'),
(32, 14, '760.00', 4, 2, 4, '2014-10-26 16:57:47'),
(33, 15, '750.00', 4, 2, 4, '2014-10-26 16:57:47'),
(34, 25, '740.00', 4, 2, 4, '2014-10-26 16:57:47'),
(35, 33, '730.00', 4, 2, 4, '2014-10-26 16:57:47'),
(36, 2, '800.00', 4, 2, 5, '2014-10-26 16:58:26'),
(37, 6, '790.00', 4, 2, 5, '2014-10-26 16:58:26'),
(38, 11, '780.00', 4, 2, 5, '2014-10-26 16:58:26'),
(39, 12, '770.00', 4, 2, 5, '2014-10-26 16:58:26'),
(40, 14, '760.00', 4, 2, 5, '2014-10-26 16:58:26'),
(41, 15, '750.00', 4, 2, 5, '2014-10-26 16:58:26'),
(42, 25, '740.00', 4, 2, 5, '2014-10-26 16:58:26'),
(43, 33, '730.00', 4, 2, 5, '2014-10-26 16:58:26'),
(44, 10, '700.00', 4, 2, 6, '2014-10-26 16:59:15'),
(45, 13, '690.00', 4, 2, 6, '2014-10-26 16:59:15'),
(46, 16, '680.00', 4, 2, 6, '2014-10-26 16:59:15'),
(47, 19, '670.00', 4, 2, 6, '2014-10-26 16:59:15'),
(48, 18, '660.00', 4, 2, 6, '2014-10-26 16:59:15'),
(49, 21, '650.00', 4, 2, 6, '2014-10-26 16:59:15'),
(50, 26, '640.00', 4, 2, 6, '2014-10-26 16:59:15'),
(51, 27, '520.00', 3, 2, 6, '2014-10-26 16:59:15'),
(52, 29, '160.00', 1, 2, 6, '2014-10-26 16:59:15');
expected results
Namn Snitt Hemma Borta Banp
Sven-Åke Jansson 200,00 200,00 0 2
Christer Wendel 199,17 197,50 200,00 6
Lars-Göran Wetterholm 198,33 200,00 197,50 7
Mikael Mårtensson 195,00 195,00 195,00 6
Sören Carlsson 195,00 195,00 0 2
Anders Svensson 193,75 193,75 0 5
Andreas Johansson 192,50 192,50 192,50 6
Jan Ingvarsson 192,50 192,50 0 2
Sören Fransson 188,75 187,50 190,00 10
Anders Johansson 185,00 185,00 0 2
Daniel Fransson 183,33 178,57 187,50 7
Mats Wellermark 182,50 0 182,50 4
Bengt Carlsson 181,25 181,25 0 4
Andreas Larsson 175,00 163,57 185,00 6
Barsom Calan 172,50 172,50 0 4
Per-Olof Johansson 172,50 172,50 0 3
Peter Ericson 171,25 171,25 0 2
Jonas Wendel 170,00 170,00 0 4
Stefan Lord 170,00 170,00 0 2
Jonas Nilsson 166,25 166,25 0 4
Mikael Nilsson 162,50 162,50 0 1
Patrik Emanuelsson 162,50 162,50 0 2
Lennart Johansson 162,00 162,00 0 3
Jörgen Norman 160,00 160,00 0 2
Maria Lord-Johansson 160,00 160,00 0 2
Roger Larsson 160,00 160,00 0 2