Re: basic sql join question...

2005-05-28 Thread Philip George
On May 29, 2005, at 1:41 AM, Jochem van Dieten wrote: http://dev.mysql.com/doc/mysql/en/group-by-modifiers.html already read that. the join in my example is more complicated than anything depicted on that page. please explain. - philip -- MySQL General Mailing List For list archives:

Re: update / subquery

2005-05-28 Thread Jochem van Dieten
On 5/29/05, Lieven De Keyzer wrote: > From: Chris >> Lieven De Keyzer wrote: >>> >>> UPDATE account >>> SET role_id = (SELECT role_id FROM role WHERE rolename = "admin") >>> WHERE username = "test" >>> >>> This gives me an: >>> ERROR 1064 (0): You have an error in your SQL syntax. Check the

Re: basic sql join question...

2005-05-28 Thread Jochem van Dieten
On 5/29/05, Philip George <[EMAIL PROTECTED]> wrote: > > +--++---+--+ > | quantity | name | price | subtotal | > +--++---+--+ > |1 | orange | 0.97 | 0.97 | > |3 | pear | 1.09 | 3.27 | > +--++-

Re: mysql and php

2005-05-28 Thread Michael Stassen
You haven't given us much to go on, other than "it doesn't work," which isn't really helpful. We can't give you "specific ideas where to look" until you give us specific details of what's wrong. Please describe what happens. Do you get an error message? What is it? While you're at it, show

Re: update / subquery

2005-05-28 Thread Lieven De Keyzer
I've got mysql-4.1.10 installed. From: Chris <[EMAIL PROTECTED]> To: mysql@lists.mysql.com Subject: Re: udpate / subquery Date: Sat, 28 May 2005 22:31:19 -0700 Syntax looks fine to me. Sub-queries are only supported in 4.1.x+ , I'm guessing that's your problem. Chris Lieven De Keyzer wrote

Re: udpate / subquery

2005-05-28 Thread Chris
Syntax looks fine to me. Sub-queries are only supported in 4.1.x+ , I'm guessing that's your problem. Chris Lieven De Keyzer wrote: UPDATE account SET role_id = (SELECT role_id FROM role WHERE rolename = "admin") WHERE username = "test" This gives me an: ERROR 1064 (0): You have an error

Re: basic sql join question...

2005-05-28 Thread Philip George
guess i'll just ask: here are the 2 tables of interest: mysql> select * from ticket_details; +-- +--+--+ | ticket | product | quantity | +

udpate / subquery

2005-05-28 Thread Lieven De Keyzer
UPDATE account SET role_id = (SELECT role_id FROM role WHERE rolename = "admin") WHERE username = "test" This gives me an: ERROR 1064 (0): You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT role_id f

basic sql join question...

2005-05-28 Thread Philip George
is it okay to post a basic sql join question to this list? if not, please point me to a list for these types of questions. thanks. - philip -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: mysql and php

2005-05-28 Thread cma7b5
From your first message below, are you suggesting a setting in Apache needs to be ticked? I can do it if I know where to look. I am no expert, just one who uses tis setup, i.e., "it just works." I have used the previous version for years and it "just worked." That's why I have no idea wh

Re: char(x) showing up as varchar(x)...

2005-05-28 Thread Philip George
thanks. - philip On May 28, 2005, at 10:08 PM, Paul DuBois wrote: http://dev.mysql.com/doc/mysql/en/silent-column-changes.html At 21:29 -0500 5/28/05, Philip George wrote: when i create a table with: CREATE TABLE person ( id char(36) NOT NULL PRIMARY KEY, firstname varchar(50)

Re: char(x) showing up as varchar(x)...

2005-05-28 Thread Paul DuBois
http://dev.mysql.com/doc/mysql/en/silent-column-changes.html At 21:29 -0500 5/28/05, Philip George wrote: when i create a table with: CREATE TABLE person ( id char(36) NOT NULL PRIMARY KEY, firstname varchar(50) DEFAULT NULL, lastname varchar(50) DEFAULT NULL ); ...and then use d

char(x) showing up as varchar(x)...

2005-05-28 Thread Philip George
when i create a table with: CREATE TABLE person ( id char(36) NOT NULL PRIMARY KEY, firstname varchar(50) DEFAULT NULL, lastname varchar(50) DEFAULT NULL ); ...and then use describe to show what i've got: mysql> describe person; +---+-+--+-+-+

Re: RESOLVED : exporting table structure/data in mysql?

2005-05-28 Thread Philip George
ahhh... thanks. good to know. - philip On May 28, 2005, at 8:57 PM, Paul DuBois wrote: At 20:50 -0500 5/28/05, Philip George wrote: ya, i just meant when you go to the main table of contents page for the docs: http://dev.mysql.com/doc/mysql/en/index.html ... there's no mention of it.

RE: performance on single column index with few distinct values

2005-05-28 Thread Daniel
Is there a composite index on (master_id, ticket_id)? Since your queries are selecting on a particular master_id, and ordering by ticket_id, along with the limit I think MySQL would be able to use such an index in an optimization. -Daniel -Original Message- From: Terence [mailto:[EMAIL PR

Re: RESOLVED : exporting table structure/data in mysql?

2005-05-28 Thread Paul DuBois
At 20:50 -0500 5/28/05, Philip George wrote: ya, i just meant when you go to the main table of contents page for the docs: http://dev.mysql.com/doc/mysql/en/index.html ... there's no mention of it. there's SHOW CREATE PROCEDURE and SHOW CREATE FUNCTION and SHOW CREATE VIEW, but no SHOW CREATE

Re: RESOLVED : exporting table structure/data in mysql?

2005-05-28 Thread Philip George
ya, i just meant when you go to the main table of contents page for the docs: http://dev.mysql.com/doc/mysql/en/index.html ... there's no mention of it. there's SHOW CREATE PROCEDURE and SHOW CREATE FUNCTION and SHOW CREATE VIEW, but no SHOW CREATE TABLE. - philip On May 28, 2005, at 8

Re: RESOLVED : exporting table structure/data in mysql?

2005-05-28 Thread Paul DuBois
At 20:26 -0500 5/28/05, Philip George wrote: this is what i was looking for: SHOW CREATE TABLE tablename; for some reason it isn't on the main doc page. - philip http://dev.mysql.com/doc/mysql/en/show-create-table.html On May 28, 2005, at 8:19 PM, Philip George wrote: what's the sql synt

mysql and php

2005-05-28 Thread cma7b5
I'm on Mac OSX and Mysql is built-in, so is php. My php has built-in support for mysql. Both php and mysql are up and running. I have tested both. All this is running on this machine, so is Apache. I can log into mysql at the CLI with my superuser and access the 'mysql' db -the only one

Re: exporting table structure/data in mysql?

2005-05-28 Thread Philip George
thanks. - philip On May 28, 2005, at 8:25 PM, Paul DuBois wrote: At 20:19 -0500 5/28/05, Philip George wrote: what's the sql syntax (in mysql) for exporting a table's structure and and data (the one that reiterates the original CREATE TABLE statement)? ..so that i'll end up with somethin

Re: RESOLVED : exporting table structure/data in mysql?

2005-05-28 Thread Philip George
this is what i was looking for: SHOW CREATE TABLE tablename; for some reason it isn't on the main doc page. - philip On May 28, 2005, at 8:19 PM, Philip George wrote: what's the sql syntax (in mysql) for exporting a table's structure and and data (the one that reiterates the original CREAT

Re: exporting table structure/data in mysql?

2005-05-28 Thread Paul DuBois
At 20:19 -0500 5/28/05, Philip George wrote: what's the sql syntax (in mysql) for exporting a table's structure and and data (the one that reiterates the original CREATE TABLE statement)? ..so that i'll end up with something that can be put in a .sql script for later imports if needed. SHOW

exporting table structure/data in mysql?

2005-05-28 Thread Philip George
what's the sql syntax (in mysql) for exporting a table's structure and and data (the one that reiterates the original CREATE TABLE statement)? ..so that i'll end up with something that can be put in a .sql script for later imports if needed. thanks. - philip -- MySQL General Mailing List F

proper varchar size for uuid storage

2005-05-28 Thread Philip George
i see a lot of variation out there on this subject. some people are using varchar(64), some varchar(32), and some other non-base2 widths. what is the proper width? i count 36 characters below, including the four dashes. mysql> select uuid(); +--+ | uuid()

Complex Query

2005-05-28 Thread Mike Blezien
Hello, I have a search query to build on two table below is the table structure, and I need to build a query to search on specific cities(or all cities),specific subjects(or all subjects) and specific levels(or all levels) # Table structure for tt_jobs and tt_jobbids # tt_jobs pid int(6)

running a system command from mysql 3.23

2005-05-28 Thread bruce
hi.. is there a way to run system commands from inside mysql if i'm using mysql3.23 (linux). in mysql-4, i simply do a 'system'... this doesn't work in 3.23... thanks bruce [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:htt

Re: error 150 / FOREIGN KEY constraint

2005-05-28 Thread Lieven De Keyzer
Thanks for the reply, but I just found out about it :) This is my table now, and it is accepted without errors: CREATE TABLE owner ( parent_id INTEGER NOT NULL, owner VARCHAR(25) NOT NULL, PRIMARY KEY (parent_id), INDEX (parent_id), FOREIGN KEY (parent_id) REFERENCES folder(folder_id) ON DEL

Re: error 150 / FOREIGN KEY constraint

2005-05-28 Thread Michael Stassen
Lieven De Keyzer wrote: This is a script I'm trying to execute. My mysql version is 4.1.10. SET FOREIGN_KEY_CHECKS = 0; DROP TABLE IF EXISTS owner; DROP TABLE IF EXISTS folder; DROP TABLE IF EXISTS account; DROP TABLE IF EXISTS role; CREATE TABLE role ( role_id INTEGER NOT NULL, rolename VARC

error 150 / FOREIGN KEY constraint

2005-05-28 Thread Lieven De Keyzer
This is a script I'm trying to execute. My mysql version is 4.1.10. SET FOREIGN_KEY_CHECKS = 0; DROP TABLE IF EXISTS owner; DROP TABLE IF EXISTS folder; DROP TABLE IF EXISTS account; DROP TABLE IF EXISTS role; CREATE TABLE role ( role_id INTEGER NOT NULL, rolename VARCHAR(25) NOT NULL, PRIMAR

Re: RENAME TABLE with CONCAT string fails

2005-05-28 Thread Paul DuBois
At 17:50 +0200 5/28/05, [EMAIL PROTECTED] wrote: Hi, As Paul said, since concat gives a string, you can use this fact in preparing statement (v4.1). This works fine for me : Ah, yes. This'll work. I forgot about prepared statements. :-) But use replace to change '-' to '_' in the table_na

Re: RENAME TABLE with CONCAT string fails

2005-05-28 Thread mfatene
Hi, As Paul said, since concat gives a string, you can use this fact in preparing statement (v4.1). This works fine for me : But use replace to change '-' to '_' in the table_name. set @tt:=concat('rename table flows_2005_05_27 to ',CONCAT("flows_", replace(DATE_SUB(CURDATE(), interval 2 day),'-

Re: RENAME TABLE with CONCAT string fails

2005-05-28 Thread Paul DuBois
At 11:00 -0400 5/28/05, Jason Dixon wrote: On May 28, 2005, at 8:51 AM, Paul DuBois wrote: At 8:12 -0400 5/28/05, Jason Dixon wrote: I'm trying to rename some tables for archival, but the table renaming is failing when I use CONCAT() to form the table string name: CONCAT() produces a string

Fw: Inner workings of a JOIN

2005-05-28 Thread cjnoyes
Meant to send this to the list. Christopher J. Noyes - Original Message - From: <[EMAIL PROTECTED]> To: "Roger Baklund" <[EMAIL PROTECTED]> Sent: Friday, May 27, 2005 9:55 PM Subject: Re: Inner workings of a JOIN Does it first create some sort of CROSS JOIN with the two tables (resul

Re: RENAME TABLE with CONCAT string fails

2005-05-28 Thread Jason Dixon
On May 28, 2005, at 8:51 AM, Paul DuBois wrote: At 8:12 -0400 5/28/05, Jason Dixon wrote: I'm trying to rename some tables for archival, but the table renaming is failing when I use CONCAT() to form the table string name: CONCAT() produces a string, not an identifier. Fine. Is there any wa

'ERROR 1045 (28000): Access denied' when trying to LOAD DATA INFILE.

2005-05-28 Thread Jeroen Van Goey
Hi all, I connect via ssh from a Linux RedHat 9 box to a remote FreeBSD server. There I can run MySQL and successfully add/remove tables etc. However, when I tried to upload a comma separated value file, I got an access denied error, although all privileges are granted to my account. What should

Challenging: Store and Query Music Lesson Management System

2005-05-28 Thread CompMan86
I am about to begin development on a website which manages the availability of a cello teacher and lessons that students have signed up for. Currently, I have two tables: Availability (date, startTime, endTime) - This table stores time spans that people can sign up for lessons Lessons (date

Re: RENAME TABLE with CONCAT string fails

2005-05-28 Thread Paul DuBois
At 8:12 -0400 5/28/05, Jason Dixon wrote: I'm trying to rename some tables for archival, but the table renaming is failing when I use CONCAT() to form the table string name: CONCAT() produces a string, not an identifier. mysql> RENAME TABLE flows TO flows_tmp, flows_new TO flows, flows_tmp

RENAME TABLE with CONCAT string fails

2005-05-28 Thread Jason Dixon
I'm trying to rename some tables for archival, but the table renaming is failing when I use CONCAT() to form the table string name: mysql> RENAME TABLE flows TO flows_tmp, flows_new TO flows, flows_tmp TO CONCAT("flows_", DATE_SUB(CURDATE(), interval 1 day)); ERROR 1064: You have an error in yo

Re: how to print warnings from mysqlimport...debug_options ??

2005-05-28 Thread Gleb Paharenko
Hello. Are you sure that you have compiled in debugging support? You have an old version of MySQL, and there was a bug when MySQL programs were showing that they have debugging, but really they were without it. Bomb Diggy <[EMAIL PROTECTED]> wrote: > I can't seem to get ahold of the

Re: 4.0 -> 4.1 undocumented incompatible change w/float?

2005-05-28 Thread Gleb Paharenko
Hello. In my opinion MySQL follows the documentation. From: http://dev.mysql.com/doc/mysql/en/numeric-types.html "When a floating-point or fixed-point column is assigned a value that exceeds the range implied by the specified (or default) precision and scale, MySQL stores the value rep

Could not initialize master info structure, check permisions on master.info

2005-05-28 Thread anurag.dashputre
Hi Everybody, I am new to the list,infact this is my first mail to the list. Ok here goes the query :- While restoring the database from backup, I am getting the following error. " ERROR 1201 at line 1: Could not initialize master info structure, check permisions on master.info " . I am doing

Re: Using MySQL to store/archive code/html etc?

2005-05-28 Thread zzapper
On Fri, 27 May 2005 15:39:36 -0400, wrote: >news <[EMAIL PROTECTED]> wrote on 05/27/2005 02:46:09 PM: > > >> > >It is possible to do just what you propose. You could even FT index your >code so that you could find certain key phrases (assuming that the >keyphrase you want is at least 4 (or 3)