I can't have group as a column name in a table?

2011-02-24 Thread Dave M G
MySQL users, Simple question: In one table in my database, the column was named group. I kept getting failed query errors until I renamed the column. I've never before encountered a situation where MySQL mistook a column name for part of the query syntax. Should I never use the word group for

Re: I can't have group as a column name in a table?

2011-02-24 Thread Aveek Misra
Use a quote around the column name or explicitly specify the column as table.column (as for e.g. mytable.group) in the query. For more details refer to http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html Thanks Aveek On Feb 24, 2011, at 4:36 PM, Dave M G wrote: MySQL users, Simple

Re: I can't have group as a column name in a table?

2011-02-24 Thread Jo�o C�ndido de Souza Neto
Have you read about reserved words in MySql? http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html -- João Cândido de Souza Neto Dave M G d...@articlass.org escreveu na mensagem news:4d663ba0.5090...@articlass.org... MySQL users, Simple question: In one table in my database, the

Re: I can't have group as a column name in a table?

2011-02-24 Thread Simcha Younger
On Thu, 24 Feb 2011 16:43:56 +0530 Aveek Misra ave...@yahoo-inc.com wrote: Use a quote around the column name or explicitly specify the column as table.column (as for e.g. mytable.group) in the query. For more details refer to http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html use

Re: I can't have group as a column name in a table?

2011-02-24 Thread Johan De Meersman
On Thu, Feb 24, 2011 at 12:06 PM, Dave M G d...@articlass.org wrote: Should I never use the word group for column names? Seems a little silly. Is there a way to protect column names to that there is no confusion? As several people already pointed out, simply use backticks. Simple quotes have

Re: I can't have group as a column name in a table?

2011-02-24 Thread Jo�o C�ndido de Souza Neto
The best comparison I´ve never seen in my life was the TNT. LOL -- João Cândido de Souza Neto Johan De Meersman vegiv...@tuxera.be escreveu na mensagem news:AANLkTikPeVuTpj9E0iepFncCJZQOF6sn_dbrhp0=p...@mail.gmail.com... On Thu, Feb 24, 2011 at 12:06 PM, Dave M G d...@articlass.org wrote:

a crash bug

2011-02-24 Thread tanzhongt
Hi: I find a crash bug, version is mysql 5.5.8 Just try: use test; drop table if exists t1,t2; create table t1(a int); create table t2(b int); PREPAREstmt FROM select sum(b) from t2 group by b having b in (select b from t1); execute stmt; -- crash

Re: I can't have group as a column name in a table?

2011-02-24 Thread mos
At 05:13 AM 2/24/2011, you wrote: Use a quote around the column name or explicitly specify the column as table.column (as for e.g. mytable.group) in the query. For more details refer to http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html Thanks Aveek Hmmm. Everyone has given me a

Re: I can't have group as a column name in a table?

2011-02-24 Thread Jo�o C�ndido de Souza Neto
LOL -- João Cândido de Souza Neto mos mo...@fastmail.fm escreveu na mensagem news:6.0.0.22.2.20110224093057.044a0...@mail.messagingengine.com... At 05:13 AM 2/24/2011, you wrote: Use a quote around the column name or explicitly specify the column as table.column (as for e.g. mytable.group)

Get date from unix_timestamp only up to the hour

2011-02-24 Thread Bryan Cantwell
How would I go about modifying a unix timestamp to actually represent the 'top of the hour' that it represents? For instance: 1296158500 = 1/27/2011 2:01:40 PM That is in the 2:00 pm hour, how can I find that out and modify it to 1296158400 which = 1/27/2011 2:00:00 PM? -- MySQL General

Re: Get date from unix_timestamp only up to the hour

2011-02-24 Thread Nathan Sullivan
Bryan, Maybe something like this would work? select 1296158500 - (1296158500 % 3600) Hope that helps, Nathan On Thu, Feb 24, 2011 at 08:41:58AM -0800, Bryan Cantwell wrote: How would I go about modifying a unix timestamp to actually represent the 'top of the hour' that it represents? For

Re: Get date from unix_timestamp only up to the hour

2011-02-24 Thread Michael Dykman
If the timestmp is in seconds, the result is simply mod(timestamp,3600) - michael dykman On Thu, Feb 24, 2011 at 11:41 AM, Bryan Cantwell bcantw...@firescope.com wrote: How would I go about modifying a unix timestamp to actually represent the 'top of the hour' that it represents? For

Re: Get date from unix_timestamp only up to the hour

2011-02-24 Thread Pintér Tibor
On 02/24/2011 05:41 PM, Bryan Cantwell wrote: How would I go about modifying a unix timestamp to actually represent the 'top of the hour' that it represents? For instance: 1296158500 = 1/27/2011 2:01:40 PM That is in the 2:00 pm hour, how can I find that out and modify it to 1296158400 which

Re: Get date from unix_timestamp only up to the hour

2011-02-24 Thread Bryan Cantwell
Yes perfect! Thanks, I knew I was over thinking this. On 02/24/2011 10:56 AM, Nathan Sullivan wrote: Bryan, Maybe something like this would work? select 1296158500 - (1296158500 % 3600) Hope that helps, Nathan On Thu, Feb 24, 2011 at 08:41:58AM -0800, Bryan Cantwell wrote: How would I go

Re: Get date from unix_timestamp only up to the hour

2011-02-24 Thread Pintér Tibor
On 02/24/2011 05:56 PM, Nathan Sullivan wrote: Bryan, Maybe something like this would work? select 1296158500 - (1296158500 % 3600) ah, yes, even this one: mysql select now() - interval (unix_timestamp() % 3600) second; +---+ | now() -

Changing the timezone

2011-02-24 Thread Andre Polykanine
Hi everyone, since I'm using the shared hosting, I can't change the default timezone for MySql. Question is: is there any query that I could launch in my connect.php before other queries to make my timezone change? For instance, I make a mysql_query(SET CHARACTER_SET_DATABASE='utf8') or

RE: Changing the timezone

2011-02-24 Thread Travis Ard
set time_zone='Europe/Kiev'; -Original Message- From: Andre Polykanine [mailto:an...@oire.org] Sent: Thursday, February 24, 2011 10:23 AM To: mysql@lists.mysql.com Subject: Changing the timezone Hi everyone, since I'm using the shared hosting, I can't change the default timezone

[X-POST] Free sample data (US Canada) for testing

2011-02-24 Thread Brian Dunning
Hey all - I've just uploaded some free Canada sample data to complement the US data that was already available. Testing apps with a representation amount of sample data is crucial to evaluate performance. Download the data here: http://www.briandunning.com/sample-data/ Enjoy, - Brian -- MySQL

Problems Connecting with SSL

2011-02-24 Thread Tim Gustafson
I have three mySQL server, all of which are SSL-enable and all of which are generally accessible from remote clients over SSL. However, one of my FreeBSD mySQL clients is having problems connecting to any of the servers. Running mySQL under truss reports the following: --