Re: Postal code searching

2012-04-25 Thread Tompkins Neil
Thanks for your very detailed response Mark. Most helpful. On Wed, Apr 25, 2012 at 10:14 AM, Mark Goodge m...@good-stuff.co.uk wrote: On 24/04/2012 17:24, Tompkins Neil wrote: How about if I want to only return postal codes that are like W1U 8JE not W13 0SU. Because in this example I

Postal code searching

2012-04-24 Thread Tompkins Neil
Hi I've a number of different postal codes in a system for example WC1B 5JA WC1H 8EJ W1J 7BX W1H 7DL NW1 1NY I can use like statements for example SELECT * FROM postal_codes WHERE zip LIKE 'W1%' giving me W1J 7BX W1H 7DL In addition I have a number of abbreviated postal codes like W1 WC1

Re: Postal code searching

2012-04-24 Thread Tompkins Neil
How about if I want to only return postal codes that are like W1U 8JE not W13 0SU. Because in this example I have W1 as the postal code and W13 is the other postal code On Tue, Apr 24, 2012 at 5:18 PM, Gary Smith li...@l33t-d00d.co.uk wrote: On 24/04/2012 17:16, Gary Smith wrote:

JOIN giving duplicate records

2012-04-03 Thread Tompkins Neil
Hi Before sending the table definition, and queries etc, can anyone advise why my query with four INNER JOIN might be give me back duplicate results e.g 100,UK,12121 100,UK,12121 Basically the query the statement AND (hotel_facilities.hotelfacilitytype_id = 47 OR

Design advice for hotel availability program

2012-02-17 Thread Tompkins Neil
Hi, I'm in the process of starting to design a hotel booking system that will eventually consist of over 10,000 hotels all with different room types, rates and availability for different dates. My question is does anyone have any experience with regards the best way to store the daily rates. Am

Chinese characters not displaying in Workbench latest version

2011-11-20 Thread Tompkins Neil
Does anyone know why Chinese characters are not displaying correctly in a replicated database on a slave machine ? I'm just getting square boxes. Thanks Neil

Re: Fwd: Large insert query gives MySQL server gone away

2011-10-12 Thread Tompkins Neil
Do you have any recommendations as to what size this should be increased to ? On Tue, Oct 11, 2011 at 12:23 AM, Angela liu yyll2...@yahoo.com wrote: Yeah, I think adjusting max packet size may be helpful, remember change that value in both server and client --

Re: Large insert query gives MySQL server gone away

2011-10-12 Thread Tompkins Neil
But how do I calculate such size ? On Wed, Oct 12, 2011 at 2:38 PM, Reindl Harald h.rei...@thelounge.netwrote: as big as you largest query Am 12.10.2011 15:30, schrieb Tompkins Neil: Do you have any recommendations as to what size this should be increased to ? On Tue, Oct 11, 2011

Re: Index question

2011-10-11 Thread Tompkins Neil
Thanks for the information. One final question in what ways should we use EXPLAIN EXTENDED statement to help improve our query performance. On Tue, Oct 11, 2011 at 2:51 PM, Johan De Meersman vegiv...@tuxera.bewrote: - Original Message - From: Rik Wasmus r...@grib.nl Depends on

Re: MySQL Indexes

2011-10-07 Thread Tompkins Neil
://dev.mysql.com/doc/refman/5.5/en/fulltext-natural-language.html http://dev.mysql.com/doc/refman/5.5/en/fulltext-natural-language.html On Thu, Oct 6, 2011 at 10:59 AM, Tompkins Neil neil.tompk...@googlemail.com neil.tompk...@googlemail.com wrote: Hi, Can anyone help and offer some advice with regards

MySQL Indexes

2011-10-06 Thread Tompkins Neil
Hi, Can anyone help and offer some advice with regards MySQL indexes. Basically we have a number of different tables all of which have the obviously primary keys. We then have some queries using JOIN statements that run slowly than we wanted. How many indexes are recommended per table ? For

Re: Slow query - please help

2011-10-05 Thread Tompkins Neil
forwarded message: From: Tompkins Neil neil.tompk...@googlemail.com Date: 30 September 2011 20:23:47 GMT+01:00 To: mark carson mcar...@pixie.co.za Cc: [MySQL] mysql@lists.mysql.com Subject: Re: Slow query - please help I downloaded version mysql-5.6.2-m5-win32.msi and he table

Re: Slow query - please help

2011-10-05 Thread Tompkins Neil
...@pixelated.net wrote: Can you post the explain extended output of your query? Sent from my iPad On Oct 4, 2011, at 2:45 PM, Neil Tompkins neil.tompk...@googlemail.com wrote: Can anyone help me ? Begin forwarded message: From: Tompkins Neil neil.tompk...@googlemail.com Date: 30 September

Fwd: Slow query - please help

2011-10-05 Thread Tompkins Neil
Following my mail below, if anyone can help optimise the query further that would be a great help. -- Forwarded message -- From: Tompkins Neil neil.tompk...@googlemail.com Date: Wed, Oct 5, 2011 at 9:48 AM Subject: Re: Slow query - please help To: Johnny Withers joh

Re: Slow query - please help

2011-10-05 Thread Tompkins Neil
my iPad On Oct 5, 2011, at 4:01 AM, Tompkins Neil neil.tompk...@googlemail.com wrote: Following my mail below, if anyone can help optimise the query further that would be a great help. -- Forwarded message -- From: Tompkins Neil neil.tompk...@googlemail.com Date

Slow query - please help

2011-09-30 Thread Tompkins Neil
Hi I've the following query : SELECT city_id, name, meta_title, meta_description, meta_keywords, country_code, link_text, folder_url, enabled, last_changed, nr_hotels, (SELECT COUNT(hotels.hotel_id) FROM hotels WHERE hotels.city_id = cities.city_id AND hotels.country_code = 'gb' AND

Re: Slow query - please help

2011-09-30 Thread Tompkins Neil
=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; On Fri, Sep 30, 2011 at 6:08 PM, mark carson mcar...@pixie.co.za wrote: Hi You need version of mysql and table/key/index layout in order to get a response Mark On 2011/09/30 17:49, Tompkins Neil wrote: Hi I've the following query

replication between two tables in same database

2011-09-29 Thread Tompkins Neil
Hi I've a Innodb and MyISAM table in the SAME database that I wish to replicate the data between the two because I need to use FULLTEXT searching on the MyISAM table. Is this possible ? If so how do I do it. Thanks Neil

Re: replication between two tables in same database

2011-09-29 Thread Tompkins Neil
Yes, unless I can set-up some sort of replication between the two tables. On Thu, Sep 29, 2011 at 6:05 PM, Reindl Harald h.rei...@thelounge.netwrote: please do NOT post off-list! so your only workaround is like '%whatever%' currently Am 29.09.2011 19:04, schrieb Tompkins Neil: The reason

Re: replication between two tables in same database

2011-09-29 Thread Tompkins Neil
...@thelounge.netwrote: you do not need any replication or myisam for select * from table where field like '%input%'; for most workloads this is enough and you have not the problem with stop-words, minimum input length and so on Am 29.09.2011 19:07, schrieb Tompkins Neil: Yes, unless I can set-up some sort

MySQL 5.6

2011-09-29 Thread Tompkins Neil
Hi Does anyone know when the production release of MySQL 5.6 will be out ? Thanks Neil

Re: replication between two tables in same database

2011-09-29 Thread Tompkins Neil
...@thelounge.net wrote: so mysql is currently the wrong database for your project sad but true, you can not have fulltext-search and innodb this time Am 29.09.2011 19:15, schrieb Tompkins Neil: We've succesfully used FULLTEXT searching on another application that does not need Innodb tables

Query help

2011-03-02 Thread Tompkins Neil
Hi I've the following basic table login_id email_address ip_address I want to extract all records from this table in which a user has used the same IP address but different email address to login ? Thanks, Neil

Re: Query help

2011-03-02 Thread Tompkins Neil
Thanks for the response. This is what I was after. Although, I am looking to find out the email addresses used to login from the same IP ? On Wed, Mar 2, 2011 at 2:49 PM, Jerry Schwartz je...@gii.co.jp wrote: -Original Message- From: Tompkins Neil [mailto:neil.tompk

Re: SELECT Help

2011-02-04 Thread Tompkins Neil
as team_id, away_user_id as user_id, last_changed from data) s1 where s1.user_id = 3 group by team_id, user_id; -Travis -Original Message- From: Tompkins Neil [mailto:neil.tompk...@googlemail.com] Sent: Thursday, February 03, 2011 6:34 AM To: [MySQL] Subject: SELECT Help Hi, I've

Re: Unknown column 'users.users_id' in 'where clause'

2011-02-04 Thread Tompkins Neil
Thanks, but how can I pass the current users value from the other query ? On Thu, Feb 3, 2011 at 4:22 PM, Simcha Younger sim...@syounger.com wrote: On Thu, 3 Feb 2011 13:55:36 + Tompkins Neil neil.tompk...@googlemail.com wrote: SELECT DISTINCT(away_teams_id) AS teams_id FROM

SELECT Help

2011-02-03 Thread Tompkins Neil
Hi, I've the following list of sample data, and need a SELECT statement to help me identify the point at which I've highlighted the data : Season, Competition, home_team_id, away_team_id, home_user_id, away_user_id, last_changed 1, 18, 11, 23, 3, 2010-11-14 17:18:17 1, 11, 8, 3, 82, 2010-11-14

Unknown column 'users.users_id' in 'where clause'

2011-02-03 Thread Tompkins Neil
Hi, I've the following SELECT statement SELECT users.gamer_tag, UNIX_TIMESTAMP(users.created_on) AS time_registered, (SELECT fixtures_results.last_changed FROM fixtures_results WHERE (home_users_id = users.users_id AND home_teams_id = users_teams.teams_id) OR (away_users_id = users.users_id AND

Error Unknown column in 'where clause'

2010-11-16 Thread Tompkins Neil
Hi I've the following query : SELECT players_bids.players_bids_id, players_bids.players_id, players_bids.bid_date, players_bids.bid_type, players_bids.bid_value, (SELECT SUM(IF(home_users_id = players_bids.users_id_from,home_manager_points,away_manager_points)) FROM fixtures_results WHERE

If within If ?

2010-10-19 Thread Tompkins Neil
Hi, I've the following query : SELECT IFNULL(SUM(gate_receipts),0) AS gate_receipts, competitions.caption FROM fixtures_results INNER JOIN competitions ON fixtures_results.competitions_id = competitions.competitions_id WHERE home_teams_id = 27 AND worlds_id = 1 AND status = 'approved' However,

Fwd: If within If ?

2010-10-19 Thread Tompkins Neil
home_teams_id = 27 AND worlds_id = 1 AND status = 'approved' Cheers Neil -- Forwarded message -- From: Tompkins Neil neil.tompk...@googlemail.com Date: Tue, Oct 19, 2010 at 2:01 PM Subject: If within If ? To: [MySQL] mysql@lists.mysql.com Hi, I've the following query : SELECT IFNULL

Fwd: Backing up MySQL using PHPMyAdmin problem with UTF-8

2010-10-18 Thread Tompkins Neil
MySQL Administrator 1.2.15 is fails with the same problem. Do anyone have any other suggestions ? -- Forwarded message -- From: Tompkins Neil neil.tompk...@googlemail.com Date: Fri, Oct 15, 2010 at 11:21 AM Subject: Re: Backing up MySQL using PHPMyAdmin problem with UTF-8

COUNT question

2010-10-18 Thread Tompkins Neil
Hi, I've the following query SELECT COUNT(players_id) AS players_count FROM players WHERE teams_id 0 GROUP BY teams_id ORDER BY players_count DESC However, I've another field called original_teams_id and want to include the COUNT with players_count, when original_teams_id = teams_id Cheers

Re: Backing up MySQL using PHPMyAdmin problem with UTF-8

2010-10-15 Thread Tompkins Neil
dump at the console. PHP does not deal with UTF very well. - michael dykman On Thu, Oct 14, 2010 at 5:48 AM, Tompkins Neil neil.tompk...@googlemail.com wrote: Hi, I'm using PHP MyAdmin to backup my MySQL database. The database is of type InnoDB and encoding used is utf8_unicode_ci

Fwd: Primary key not unique on InnoDB table

2010-10-15 Thread Tompkins Neil
Based on my reply below, do you recommend I continue to have these indexes ? -- Forwarded message -- From: Tompkins Neil neil.tompk...@googlemail.com Date: Wed, Oct 13, 2010 at 8:22 PM Subject: Re: Primary key not unique on InnoDB table To: Travis Ard travis_...@hotmail.com Cc

Re: Backing up MySQL using PHPMyAdmin problem with UTF-8

2010-10-15 Thread Tompkins Neil
in and do your dump at the console. PHP does not deal with UTF very well. - michael dykman On Thu, Oct 14, 2010 at 5:48 AM, Tompkins Neil neil.tompk...@googlemail.com wrote: Hi, I'm using PHP MyAdmin to backup my MySQL database. The database is of type InnoDB and encoding used

Backing up MySQL using PHPMyAdmin problem with UTF-8

2010-10-14 Thread Tompkins Neil
Hi, I'm using PHP MyAdmin to backup my MySQL database. The database is of type InnoDB and encoding used is utf8_unicode_ci. The variables are set as follows : *MySQL connection collation: **utf8_unicode_ci* *MySQL charset: **UTF-8 Unicode (utf8)* *character set client: utf8* *character set

Fwd: Backing up the InnoDB tables

2010-10-13 Thread Tompkins Neil
Would really appreciate some help or suggestions on this please, if anyone can assist ? Regards Neil -- Forwarded message -- From: Tompkins Neil neil.tompk...@googlemail.com Date: Tue, Oct 12, 2010 at 5:45 PM Subject: Backing up the InnoDB tables To: [MySQL] mysql@lists.mysql.com

Re: Backing up the InnoDB tables

2010-10-13 Thread Tompkins Neil
The problem is I don't have any command line access, just direct MySQL access to the database tables. On Wed, Oct 13, 2010 at 1:19 PM, Suresh Kuna sureshkumar...@gmail.comwrote: use xtra backup On Wed, Oct 13, 2010 at 5:37 PM, Tompkins Neil neil.tompk...@googlemail.com wrote: Would

Primary key not unique on InnoDB table

2010-10-13 Thread Tompkins Neil
I've the following table. But why isn't the primary key unique, e.g. preventing duplicates if entered ? CREATE TABLE `players_master` ( `players_id` bigint(20) NOT NULL AUTO_INCREMENT, `default_teams_id` bigint(20) NOT NULL, `first_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,

Re: Primary key not unique on InnoDB table

2010-10-13 Thread Tompkins Neil
single primary key. Am I wrong? -- João Cândido de Souza Neto Tompkins Neil neil.tompk...@googlemail.com escreveu na mensagem news:aanlkti=-1wvuxdfsq4km6rfz0wsrlpphug1bnt4x9...@mail.gmail.com... I've the following table. But why isn't the primary key unique, e.g. preventing duplicates

Re: Primary key not unique on InnoDB table

2010-10-13 Thread Tompkins Neil
is autoincrement. Am I completely wrong? -- João Cândido de Souza Neto Tompkins Neil neil.tompk...@googlemail.com escreveu na mensagem news:aanlkti=xnjcaiq7bmoxg-q+4nowdhv8uaj9dcqrol...@mail.gmail.com... Sorry Joao, I thought that was pretty standard to have a primary key with auto_increment ?? 2010

Re: Primary key not unique on InnoDB table

2010-10-13 Thread Tompkins Neil
On Wed, Oct 13, 2010 at 8:07 PM, Tompkins Neil neil.tompk...@googlemail.com wrote: I've the following table. But why isn't the primary key unique, e.g. preventing duplicates if entered ? CREATE TABLE `players_master` ( `players_id` bigint(20) NOT NULL AUTO_INCREMENT, `default_teams_id

Re: Primary key not unique on InnoDB table

2010-10-13 Thread Tompkins Neil
Shawn it is fine. I thought my primary key was just 1 field. On Wed, Oct 13, 2010 at 4:44 PM, Shawn Green (MySQL) shawn.l.gr...@oracle.com wrote: On 10/13/2010 11:37 AM, Tompkins Neil wrote: Shawn, sorry my error, I didn't realise I had two fields as the primary key That's

Re: Primary key not unique on InnoDB table

2010-10-13 Thread Tompkins Neil
requirements. -Travis -Original Message- From: Tompkins Neil [mailto:neil.tompk...@googlemail.com] Sent: Wednesday, October 13, 2010 8:37 AM To: [MySQL] Subject: Primary key not unique on InnoDB table I've the following table. But why isn't the primary key unique, e.g. preventing

Backing up the InnoDB tables

2010-10-12 Thread Tompkins Neil
Hi On a shared MySQL server with access just to my own database, what is the recommend backup methods and strategies for the InnoDB tables ? Cheers Neil

Re: innodb backup

2010-10-11 Thread Tompkins Neil
I'm interested in InnoDB backups. Does anyone use PHPMyAdmin ? I've a MySQL server on a shared hosting server. Cheers Neil On Sat, Oct 9, 2010 at 3:21 AM, short.cut...@yahoo.com.cn wrote: Hello, Is there any good document for backup of InnoDB? includes the increment backup and full

Query working on 5.1.43 and not 5.0.77

2010-10-07 Thread Tompkins Neil
Hi, My hosting company are only running MySQL version 5.0.77 and at this current time are not planning on upgrading to at least my required version of 5.1.43. My query in which I have some problems is shown below : SELECT teams_id AS teams_id ,SUM(rating) AS total_team_rating FROM (SELECT

Fwd: Design advice

2010-10-07 Thread Tompkins Neil
Wonder if anyone can help me ? -- Forwarded message -- From: Tompkins Neil neil.tompk...@googlemail.com Date: Tue, Oct 5, 2010 at 10:07 AM Subject: Design advice To: [MySQL] mysql@lists.mysql.com Hi I have a number of tables of which I use to compute totals. For example I have

Re: Indexing question

2010-10-05 Thread Tompkins Neil
Message- From: Tompkins Neil [mailto:neil.tompk...@googlemail.com] Sent: Monday, October 04, 2010 8:54 AM To: Joerg Bruehe Cc: [MySQL] Subject: Re: Indexing question Jörg Thanks for the useful reply. Maybe I can EXPLAIN my select queries for you to advise if any changes need to be made

Design advice

2010-10-05 Thread Tompkins Neil
Hi I have a number of tables of which I use to compute totals. For example I have table : players_master rec_id players_name teams_id rating I can easily compute totals for the field rating. However, at the end of a set period within my application, the values in the rating field are changed.

Re: Indexing question

2010-10-04 Thread Tompkins Neil
Jörg Thanks for the useful reply. Maybe I can EXPLAIN my select queries for you to advise if any changes need to be made ? Regards Neil On Mon, Oct 4, 2010 at 3:38 PM, Joerg Bruehe joerg.bru...@oracle.comwrote: Hi! Neil Tompkins wrote: Thanks for your reply. So should we create

MySQL DB Version

2010-10-04 Thread Tompkins Neil
Account Number : uk600724 Dear Sir/Madam, The MySQL database version which you have supplied to us is version 5.0.77. However, it would appear that we require version to be at least 5.1.43. How can we get our MySQL db upgraded to this version or greater ? Regards Neil Tompkins

Re: Indexing question

2010-10-03 Thread Tompkins Neil
So if you have individual indexes for example field_1, field_2 and field_3 etc and then perform a search like WHERE field_1 = 10 AND field_3 = 'abc' This wouldn't improve the search ? You have to create a index for all possible combined field searches ? On Fri, Oct 1, 2010 at 9:35 PM, Gavin

SUM Top 10 records

2010-09-28 Thread Tompkins Neil
Hi I've a basic table like and want to SUM the top 5 values. For example if I have id, rating 0, 10 1, 25 2, 5 3, 10 4, 50 5, 1 6, 15 7, 20 8, 9 I want my query to sum the values 4,50 1,25 7,20 6.15 0,10 Suming a value of 120 Any suggestions on how to achieve this ? Cheers Neil

Re: SUM Top 10 records

2010-09-28 Thread Tompkins Neil
Christoph, this SUMs all values ? On Tue, Sep 28, 2010 at 11:25 AM, Christoph Boget christoph.bo...@gmail.com wrote: I've a basic table like and want to SUM the top 5 values. For example if I have Any suggestions on how to achieve this ? SELECT SUM( rating ) as total_rating FROM

Re: Advanced query help

2010-09-27 Thread Tompkins Neil
Hi, I did try defining it before the IF statement, but still the same ? Cheers Neil On Mon, Sep 27, 2010 at 7:58 AM, Johan De Meersman vegiv...@tuxera.bewrote: At a guess, because you use @team in an if statement before you actually define it. On Sun, Sep 26, 2010 at 12:35 AM, Tompkins

Advanced query help

2010-09-25 Thread Tompkins Neil
Hi, I've the following query SELECT teams_id AS teams_id ,SUM(rating) AS total_team_rating FROM (SELECT teams_id ,players_id ,rating ,IF(@team teams_id, @row := 1, @row := @row + 1) AS rank ,@team := teams_id FROM ( SELECT players.teams_id ,players.players_id ,players_master.rating FROM players

Matrix Stats Login

2010-09-24 Thread Tompkins Neil
User fifaleagues Pass DrUch929eHek9Huwa7HAcH6wRUk5QaTr

Fwd: Matrix Stats Login

2010-09-24 Thread Tompkins Neil
Sorry, this message was sent in error, please ignore. -- Forwarded message -- From: Tompkins Neil neil.tompk...@googlemail.com Date: Fri, Sep 24, 2010 at 5:41 PM Subject: Matrix Stats Login To: [MySQL] mysql@lists.mysql.com User Pass

Query help please

2010-09-23 Thread Tompkins Neil
Hi all, I've the following query : SELECT fixtures_results.seasons_id , home_teams_id AS teams_id , 1 AS home ,0 AS away , (SELECT SUM(goals) FROM players_appearances WHERE fixtures_results.fixtures_results_id = players_appearances.fixtures_results_id AND players_appearances.teams_id =

Fwd: Query help please

2010-09-23 Thread Tompkins Neil
I wondered if anyone can help me ? Do you need any further information ? Cheers Neil -- Forwarded message -- From: Tompkins Neil neil.tompk...@googlemail.com Date: Thu, Sep 23, 2010 at 9:49 AM Subject: Query help please To: [MySQL] mysql@lists.mysql.com Hi all, I've

SELECT WHERE IN help

2010-09-21 Thread Tompkins Neil
Hi With a SELECT * FROM my_table WHERE record_id IN (3,4,5,6,7,3), how can I return two records for the record_id 3 ? Is it possible ? Cheers Neil

Re: SELECT WHERE IN help

2010-09-21 Thread Tompkins Neil
Meersman vegiv...@tuxera.bewrote: If there are two, you will return two. On Tue, Sep 21, 2010 at 5:33 PM, Tompkins Neil neil.tompk...@googlemail.com wrote: Hi With a SELECT * FROM my_table WHERE record_id IN (3,4,5,6,7,3), how can I return two records for the record_id 3 ? Is it possible

Re: SELECT WHERE IN help

2010-09-21 Thread Tompkins Neil
? The whole point of an RDBMS is to *avoid* duplicate data :-) On Tue, Sep 21, 2010 at 5:44 PM, Tompkins Neil neil.tompk...@googlemail.com wrote: Thanks for the quick reply. Basically in (3,4,5,6,7,3) the record_id of 3 only exists once in the table my_table. However, because 3 exists twice

Re: Encryption with MYSQL

2010-09-20 Thread Tompkins Neil
: hex() and unhex() should do the trick in mysql (not base64, but same idea). Those will transform every byte into a pair of hexadecimal digits - thus limited to 0-9 and A-F - and reverse the process. On Fri, Sep 17, 2010 at 2:13 PM, Tompkins Neil neil.tompk...@googlemail.com wrote: Sorry

Encryption with MYSQL

2010-09-17 Thread Tompkins Neil
Hi, I need to encrypt a string like 'hello world', using a passkey. But I also need to be able to decrypt the encrypted phrase using the same passkey. I noticed in MySQL there are functions like AES_ENCRYPT()http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html#function_aes-encrypt

SHA1 returns binary value

2010-09-17 Thread Tompkins Neil
Hi Why when I run the command (MySQL 5.1) SELECT SHA1('abc'); is it returned as a binary value and not a string value ? Cheers Neil

Improve query

2010-09-16 Thread Tompkins Neil
Hi, Regarding my query below, is there anyway in which this query can be improved ? SELECT t1.players_brought, t2.players_sold, t3.team_balance, t4.home_team_wages, t5.away_team_wages, (t3.team_balance+t2.players_sold)-(t1.players_brought+t4.home_team_wages+t5.away_team_wages) AS team_balance,

Fwd: Query SUM help

2010-09-09 Thread Tompkins Neil
Any help would be really appreciated ? -- Forwarded message -- From: Tompkins Neil neil.tompk...@googlemail.com Date: Wed, Sep 8, 2010 at 5:30 PM Subject: Query SUM help To: [MySQL] mysql@lists.mysql.com Hi I've the following query : SELECT total_team_rating, my_teams_id

Re: Query SUM help

2010-09-09 Thread Tompkins Neil
PM, Tompkins Neil neil.tompk...@googlemail.com wrote: Any help would be really appreciated ? -- Forwarded message -- From: Tompkins Neil neil.tompk...@googlemail.com Date: Wed, Sep 8, 2010 at 5:30 PM Subject: Query SUM help To: [MySQL] mysql@lists.mysql.com Hi I've

Table design help

2010-09-09 Thread Tompkins Neil
Hi all, Needing some advice on my tables design. Basically I am designing a soccer application, and have a table which contains player_bids (the values of which a player costs to be transferred between clubs). Can someone please offer some input on the best way in which I should design the

Query SUM help

2010-09-08 Thread Tompkins Neil
Hi I've the following query : SELECT total_team_rating, my_teams_id FROM (SELECT players.teams_id AS my_teams_id, SUM(players_master.rating) AS total_team_rating FROM players INNER JOIN players_master ON players.players_id = players_master.players_id WHERE players.worlds_id = 1 AND

Re: Best method to keep totals

2010-09-06 Thread Tompkins Neil
Just another quick question - following my initial question regarding the best method to keep totals, I wondered if I should adopt a table to record team league standings like based on each result like team_id home_win home_draw home_loss home_goals home_conceded away_win away_draw away_loss

Query help

2010-09-06 Thread Tompkins Neil
Hi, I've the following fields within a table : fixtures_results_id home_teams_id away_teams_id home_goals away_goals home_users_id away_users_id From this I want to extract the following type of information if the home_users_id or away_users_id = 1 : total number of games games number of games

Re: Query help

2010-09-06 Thread Tompkins Neil
These two fields home_goals and away_goals Cheers Neil On Mon, Sep 6, 2010 at 12:58 PM, Ananda Kumar anan...@gmail.com wrote: Tompkins, Which field stores the result of matches. regards anandkl On Mon, Sep 6, 2010 at 4:45 PM, Tompkins Neil neil.tompk...@googlemail.com wrote: Hi

Re: Query help

2010-09-06 Thread Tompkins Neil
, Ananda Kumar anan...@gmail.com wrote: Also, can u please lets u know the value's in this table. Just one row, an example would do. regards anandkl On Mon, Sep 6, 2010 at 5:35 PM, Tompkins Neil neil.tompk...@googlemail.com wrote: These two fields home_goals and away_goals Cheers

Re: Dup Key Error Messages

2010-09-06 Thread Tompkins Neil
Hi You have a PRIMARY KEY of just the id field like PRIMARY KEY ( `id` ). You need both ip and type to be the primary key Cheers Neil On Mon, Sep 6, 2010 at 2:02 PM, Thorsten Heymann heym...@macnetix.dewrote: Hi, First, I'm new to this mailing list, hopefully I'll do my post the *right*

Re: Calculating table standings

2010-09-06 Thread Tompkins Neil
home_goals, 1, 0) as lost_away ,away_goals as scored_away ,home_goals as conceded_away from matches) s1 group by seasons_id, team_id; -Original Message- From: Tompkins Neil [mailto:neil.tompk...@googlemail.com] Sent: Tuesday, August 24, 2010 7:45 AM To: [MySQL] Subject

Fwd: Database design help

2010-09-01 Thread Tompkins Neil
Looking for some help / comments if possible ? Cheers Neil -- Forwarded message -- From: Neil Tompkins neil.tompk...@googlemail.com Date: Tue, Aug 31, 2010 at 8:48 PM Subject: Database design help To: mysql@lists.mysql.com Hi I've a soccer application consisting of managers,

Re: Database design help

2010-09-01 Thread Tompkins Neil
I do have a tabled which contains both the managers_id and teams_id for the current teams managed. I think by adding the managers_id alongside the fixture_result table will then allow me to find which points the manager has accumulated alongside which fixtures and teams. Cheers Neil On Wed,

Best method to keep totals

2010-09-01 Thread Tompkins Neil
Hi, I'm developing a system whereby a manager gets assigned points based a certain number of factors which are saved alongside a football result. However, I also want to keep a total for each manager. My question is it best to just have a query that uses SUM to total the managers points gained

Re: Best method to keep totals

2010-09-01 Thread Tompkins Neil
Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 E-mail: je...@gii.co.jp Web site: www.the-infoshop.com -Original Message- From: Tompkins Neil [mailto:neil.tompk...@googlemail.com] Sent: Wednesday, September 01, 2010 4:29 PM To: [MySQL] Subject

MySQL SUM on two columns

2010-08-31 Thread Tompkins Neil
Hi, I've the following basic SUM for our products based on a rating. SELECT SUM(products.rating) AS products_rating FROM products_sales INNER JOIN products ON products_sales.products_id = products.products_id WHERE products.enabled = 1 AND products_sales.language = 'EN' This works fine, however

Re: MySQL SUM on two columns

2010-08-31 Thread Tompkins Neil
grouping http://dev.mysql.com/doc/refman/5.0/en/group-by-modifiers.html see second example on that page. regards, m -Original Message- From: Tompkins Neil [mailto:neil.tompk...@googlemail.com] Sent: Tuesday, August 31, 2010 11:43 AM To: [MySQL] Subject: MySQL SUM on two columns

Re: MySQL SUM on two columns

2010-08-31 Thread Tompkins Neil
= products.products_id WHERE products.enabled = 1 AND products_sales.language IN ('EN','ES') GROUP BY products_sales.language Will give the sum for each language. On 31 August 2010 11:42, Tompkins Neil neil.tompk...@googlemail.comwrote: Hi, I've the following basic SUM for our products

Re: MySQL SUM on two columns

2010-08-31 Thread Tompkins Neil
Hi, I also wondered, if there is any way to LIMIT the products.rating for each language to say the top 25 ? Cheers Neil On Tue, Aug 31, 2010 at 12:11 PM, Tompkins Neil neil.tompk...@googlemail.com wrote: Perfect. Exactly what I was looking for. Cheers John. Regards, Neil On Tue, Aug

Retrieve three columns in sub query

2010-08-25 Thread Tompkins Neil
Hi Is it possible in MySQL 5.1 to retrieve three columns in a select sub-query like below : SELECT student_age, SELECT (student_subjects_id, random_mark, subject FROM student_subjects ORDER BY RAND(), LIMIT 1) FROM students WHERE student_age 10 ORDER BY RAND() LIMIT 1 I've looked and tried

Re: Retrieve three columns in sub query

2010-08-25 Thread Tompkins Neil
Souza Neto Tompkins Neil neil.tompk...@googlemail.com escreveu na mensagem news:aanlkti=djkujcsg=kf29sjsp0yllhmhb02mqzdvzd...@mail.gmail.com... Hi Is it possible in MySQL 5.1 to retrieve three columns in a select sub-query like below : SELECT student_age, SELECT (student_subjects_id

Re: Retrieve three columns in sub query

2010-08-25 Thread Tompkins Neil
: Tompkins Neil [mailto:neil.tompk...@googlemail.com] Sent: Wednesday, August 25, 2010 1:23 PM To: [MySQL] Subject: Retrieve three columns in sub query Hi Is it possible in MySQL 5.1 to retrieve three columns in a select sub-query like below : SELECT student_age, SELECT

Table design question

2010-08-25 Thread Tompkins Neil
Hi, I'm creating a application which hosts football matches and I want to record the player appearances, goals etc. I was thinking of having a record for each player as follows : appearance_id season_id player_id team_id competition_id appearance goals yellow_card red_card date_played Is this

Re: Calculating table standings

2010-08-25 Thread Tompkins Neil
,if(away_goals = home_goals, 1, 0) as draw_away ,if(away_goals home_goals, 1, 0) as lost_away ,away_goals as scored_away ,home_goals as conceded_away from matches) s1 group by seasons_id, team_id; -Original Message- From: Tompkins Neil [mailto:neil.tompk...@googlemail.com

Calculating table standings

2010-08-24 Thread Tompkins Neil
Hi, I wondered if anyone can offer me some help with regards the following issue I'm having. Basically, I've the following table structure containing rows of results between two football teams. The fields are match_id seasons_id week_number home_team_id away_team_id home_goals away_goals

SUM value like 10,23,15,10

2010-08-24 Thread Tompkins Neil
Hi In MySQL is it possible to SUM a field which contains like 10,23,15,10. The result I'd be looking for is 10 = count of 2 23 = count of 1 15 = count of 1 Cheers Neil

Re: SUM value like 10,23,15,10

2010-08-24 Thread Tompkins Neil
a group by that field and select the count() of it. On Tue, Aug 24, 2010 at 3:53 PM, Tompkins Neil neil.tompk...@googlemail.com wrote: Hi In MySQL is it possible to SUM a field which contains like 10,23,15,10. The result I'd be looking for is 10 = count of 2 23 = count of 1 15

Re: SUM value like 10,23,15,10

2010-08-24 Thread Tompkins Neil
:-) You could maybe build a stored procedure, or do it in the app; but it's gonna be code either way. On Tue, Aug 24, 2010 at 3:58 PM, Tompkins Neil neil.tompk...@googlemail.com wrote: Yeah these values are held with a varchar field. On Tue, Aug 24, 2010 at 2:56 PM, Johan De Meersman

Re: Calculating table standings

2010-08-24 Thread Tompkins Neil
: Tompkins Neil [mailto:neil.tompk...@googlemail.com] Sent: Tuesday, August 24, 2010 7:45 AM To: [MySQL] Subject: Calculating table standings Hi, I wondered if anyone can offer me some help with regards the following issue I'm having. Basically, I've the following table structure containing rows

Re: Fixture List generation using MySQL

2010-08-20 Thread Tompkins Neil
. Regards, Gavin Towey -Original Message- From: Tompkins Neil [mailto:neil.tompk...@googlemail.com] Sent: Thursday, August 19, 2010 10:07 AM To: [MySQL] Subject: Re: Fixture List generation using MySQL I'm looking at a routine / script to create the fixtures like team 1 vs team 2 team

Fixture List generation using MySQL

2010-08-19 Thread Tompkins Neil
Hi, I'm tasked with generating a list of fixtures from a table of teams, whereby each team plays each other home and away. Does anyone have any experience generating such information using MySQL ? Thanks for any input. Regards Neil

Re: Fixture List generation using MySQL

2010-08-19 Thread Tompkins Neil
team plays each other home and away. Does anyone have any experience generating such information using MySQL ? Basically ... select a.id,b.id from tbl a join tbl b on a.idb.id; union select a.id,b.id from tbl a join tbl b on a.idb.id; PB - On 8/19/2010 9:12 AM, Tompkins Neil wrote

  1   2   >