Re: OT: SQL Question

2012-03-25 Thread David Turner
Jeff, I would use a join table, teacher_flights. create table teacher_flights( teacher_id int(11) not null, flight_id int(11) not null, primary key(teacher_id, flight_id)); Dave From: Mark Phillips m...@phillipsmarketing.biz To: Mysql List

Re: big character constant

2012-03-25 Thread David Turner
select 'U02714','U02718'; insert into my_table values('U02714'); insert into my_table values('U02718'); Let me know if this is what you intended. Dave From: h...@tbbs.net h...@tbbs.net To: mysql@lists.mysql.com Sent: Friday, March 23, 2012 5:14 PM

Re: InnoDB Indices

2006-03-09 Thread David Turner
- Original Message From: Robert DiFalco [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Thursday, March 9, 2006 9:32:44 AM Subject: InnoDB Indices I have some questions regarding InnoDB indices. Say I have a table with millions of records. On of the fields is a type field that has

Re: How to find missing rows from subset of table using Left Join?

2005-11-09 Thread David Turner
. There are exceptions to this rule. If you could send a sample of table1, table2, and the result set you want to arrive at I'd appreciate it. Dave --- mos [EMAIL PROTECTED] wrote: At 09:54 PM 11/8/2005, David Turner wrote: If you could present sample data of both table1, table2, and an example

Re: How to find missing rows from subset of table using Left Join?

2005-11-08 Thread David Turner
If you could present sample data of both table1, table2, and an example of the result set it would be easier to give you the sql. I believe you could eliminate the temporary table with a subselect in the original query. The subselect is where you would specify 'Smith'. Dave --- mos [EMAIL

Re: How to SELECT something (CONCAT) and search the field

2005-06-23 Thread David Turner
select first_name, lastname from user where first_name like '%$user%' or last_name like '%$user%' ; --- Matt Babineau [EMAIL PROTECTED] wrote: Hey All- Got a fun question - I hit the manual but not much luck on my question. I want to combine 2 fields and then search them SELECT

RE: Indexing for OR clauses

2004-10-04 Thread David Turner
, no? -Dave -Original Message- From: David Turner [mailto:[EMAIL PROTECTED] Sent: October 1, 2004 4:04 PM To: [EMAIL PROTECTED] Subject: Indexing for OR clauses Wondering if anyone can give me advice on indexing for OR clauses. I have a table with a number of fields, two of which are sender_id

Indexing for OR clauses

2004-10-01 Thread David Turner
Wondering if anyone can give me advice on indexing for OR clauses. I have a table with a number of fields, two of which are sender_id and receiver_id. I also have a query such as this: SELECT ... WHERE (sender_id = 98765 OR reciever_id = 98765) The query is OK for a limit of 10, but if I

Eliminating downtime

2002-05-29 Thread David Turner
Has anyone architected an oltp database using mysql where downtime is virtually eliminated? I understand it's fairly simple to set up a readonly system using mysql replication or another type of replication to maintain the uptime, but I have yet to see how to do this with a heavy transaction

Re: Eliminating downtime

2002-05-29 Thread David Turner
The thing is I'm looking for a solution with guaranteed transaction success. I have thought about building a layer that would guarantee transaction success. Say I had two duplicate databases and if a transaction failed on one it would still succeed on the other. Once the transaction failed it

Downgrade

2002-04-18 Thread David Turner
Are there any steps I need to take to ensure no corruption of the database if I downgrade from say 3.23.49 to 3.23.48 Thanks, Dave query,sql - Before posting, please check: http://www.mysql.com/manual.php (the manual)

Re: prefix

2002-04-10 Thread David Turner
I guess make install prefix=/home/turner/mysql/test just isn't an option. How would I request this functionality be provided in the make file? Thanks, Dave Turner On Tue, Apr 09, 2002 at 05:45:04PM -0700, David Turner wrote: Thanks, but what I need to do is have make install install

Re: prefix

2002-04-09 Thread David Turner
=/home/turner/mysql/test Thanks, Dave On Tue, Apr 09, 2002 at 05:41:08PM -0700, Jeremy Zawodny wrote: On Tue, Apr 09, 2002 at 05:30:06PM -0700, David Turner wrote: I would like to make install to my home directory but can't seem to get it to work. make install prefix=/home/turner/mysql

Re: backup databases

2002-04-02 Thread David Turner
Check out cygwin.com. I think it's free. Great for unix guys having to run on NT. Dave On Tue, Apr 02, 2002 at 05:25:15PM -0600, Russell E Glaue wrote: On Tue, 2 Apr 2002, Mark Stringham wrote: What would the script look like if I'm on Win2k ? Good luck!! But seriously; there is a

mysql slave status

2002-03-12 Thread David Turner
Does anyone have a script to check on the replication status of the slave to make sure it isn't falling too far behind? Thanks, Dave Turner sql - Before posting, please check: http://www.mysql.com/manual.php (the manual)

Re: LOAD DATA INFILE and how to ignore garbage lines at end of load file?

2002-03-04 Thread David Turner
Is this a true export? Because I've never had garbage lines in my files. Dave On Mon, Mar 04, 2002 at 10:33:14AM -0600, Paul DuBois wrote: At 10:58 -0500 3/4/02, Richard Bolen wrote: I'm exporting data from Oracle and importing it into MySQL. The problem is Oracle puts garbage lines at the

Re: Linux optimizations for MySQL

2002-02-25 Thread David Turner
If you do that don't you run a greater risk of corruption of the datafiles if the host unexpectedly goes down? Dave On Mon, Feb 25, 2002 at 01:07:06PM -0800, Steven Roussey wrote: I was reading an article on speeding up Oracle on Linux(1) and thought their two optimizations for Linux would

Re: Linux optimizations for MySQL

2002-02-25 Thread David Turner
rebuilt. 2 disk SCSI RAID 0 is not enough. 4 disk SCSI RAID 0 or 4 disk SCSI 0+1 is much better. Sincerely, Steven Roussey http://Network54.com/?pp=e -Original Message- From: David Turner [mailto:[EMAIL PROTECTED]] If you do that don't you run a greater risk of corruption

Re: max suffice

2002-02-22 Thread David Turner
On Sat, Feb 23, 2002 at 12:39:43AM +0100, [EMAIL PROTECTED] wrote: Your message cannot be posted because it appears to be either spam or simply off topic to our filter. To bypass the filter you must include one of the following words in your message: sql,query If you just reply to this

Re: ORDER BY an ABSolute value

2002-02-12 Thread David Turner
select id from table_name order by abs(id); Dave Dundee! On Tue, Feb 12, 2002 at 09:46:25AM +1000, David Mackay wrote: G'Day folks, New to PHP/MySQL. Want to order the results of a SELECT by their 'absolute' value, not their sign. So regardless of whether it's +37 or -37, they

Re: ORDER BY an ABSolute value

2002-02-11 Thread David Turner
Paste your sql exactly as it is and your version of mysql. Dave On Tue, Feb 12, 2002 at 10:08:10AM +1000, David Mackay wrote: Thanks for your quick response Dave, Have tried this, but no bannana... I get: You have an error in your SQL syntax near 'abs(id)' at line 1 Seems a not-valid

Re: Missing values in an INT type column

2002-02-01 Thread David Turner
MAX_EXTENSION= select a.id + 1 from dude a left join dude b on a.id +1 = b.id where b.id is null and a.id MAX_EXTENSION; You'll have to have one record in the table for this to work. I've done a better job of this in Oracle because of nested queries, but I think this could give you a

Run a file from mysql prompt

2002-02-01 Thread David Turner
How do I get a file full of sql commands to run from the mysql prompt? In oracle I would type @thefilename I know how to do run the file from the unix prompt mysql thefilename.sql Thanks, Dave - Before posting, please

Re: Run a file from mysql prompt

2002-02-01 Thread David Turner
Cool, thx. Dave On Fri, Feb 01, 2002 at 01:21:18PM -0600, Paul DuBois wrote: At 11:12 -0800 2/1/02, David Turner wrote: How do I get a file full of sql commands to run from the mysql prompt? mysql source filename; or mysql \. filename; In oracle I would type

Re: three-way join

2002-01-23 Thread David Turner
Sorry not real familar with MYSQL syntax yet but I think you'll be able to translate. select m.magazinename from s,m,b where s.name = 'fred' and s.id=b.subscriberid and m.id=b.magazineid ; On Wed, Jan 23, 2002 at 03:59:11PM -0700, Christopher Thompson wrote: At 02:51 PM

Re: Backups

2001-12-18 Thread David Turner
Another suggestion I saw someone make that seems reasonable is to use a break away mirror for backups. I think they lock the tables for a minute break the mirror and unlock the tables. Then they backup the broken mirror at their leisure. Dave On Tue, Dec 18, 2001 at 06:00:49PM -0500, Dave Greco

Re: sequence and nextval

2001-12-13 Thread David Turner
Try sequences. Dave On Thu, Dec 13, 2001 at 06:18:32PM -, Matthew Smith wrote: the SELECT LAST_INSERT_ID() gets the last autoincremented number for the current connection. See http://www.mysql.com/doc/G/e/Getting_unique_ID.html The auto_incremenet field is sadly lacking in Oracle

Re: Circular replication

2001-12-12 Thread David Turner
Just tell your boss that if you ever have turnover the former employee will be able to log into all the customers' accounts and do whatever he wants. Dave On Thu, Dec 13, 2001 at 03:29:41AM +1100, Duncan Maitland wrote: My questions concern a setup where a public server is running at our

Re: Very large table load/index questions

2001-12-04 Thread David Turner
I've always thought it would be great if there was a way to drop an object but keep the meta data so I can recreate objects without having to store the ddl somewhere. alter table drop index retain metadata Would be helpful. Dave On Tue, Dec 04, 2001 at 11:19:43AM -0500, Robert Alexander

Re: Very large table load/index questions

2001-12-04 Thread David Turner
Thanks, but I'm looking at having this for all objects drop table mytable retain metadata; etc Dave On Tue, Dec 04, 2001 at 06:52:17PM +0100, Sergei Golubchik wrote: Hi! On Dec 04, David Turner wrote: I've always thought it would be great if there was a way to drop an object but keep

Re: MySQL performance and limit

2001-10-05 Thread David Turner
BTW, this is unique in MySQL - you can have tables mixed to be transactional (InnoDB) and nontransactional (MyISAM) and use them mixed in same query. All other SQL-s (as much I know) have transactions on Oracle's Global Temporary Tables don't write to redo or rollback, and on normal tables

Re: MySQL performance and limit

2001-10-05 Thread David Turner
No problem, MYSQL is great and I know far less about it than I do Oracle. Dave On Fri, Oct 05, 2001 at 06:08:07PM +0200, Tonu Samuel wrote: On Fri, 2001-10-05 at 17:06, David Turner wrote: BTW, this is unique in MySQL - you can have tables mixed to be transactional (InnoDB

Re: Creating indexes on large tables

2001-10-03 Thread David Turner
If this is the case. What are the steps necessary for index rebuilds? Can I specify where the index file is rebuilt? Any idea when we can specify the location of datafiles and indexfiles? Thanks, Dave On Wed, Oct 03, 2001 at 07:57:35AM -0700, Adams, Bill TQO wrote: Perhaps your index file

Re: RE: Info Needed to Promote MySQL!!

2001-09-24 Thread David Turner
I've had the same issues. I have really avoided the dev side of things for some time so I'm not sure whether there's a way around it. Mainly just devoting myself to administration. Funny though I'm starting to write jsp stuff to monitor the databases more effectively. I agree with you on the

Re: RE: Info Needed to Promote MySQL!! - Solved

2001-09-24 Thread David Turner
On Mon, Sep 24, 2001 at 03:02:42PM -0700, Venu wrote: Hi Another small research in Access made me to see the changed table structure completely. Please use this procedure to view or to refresh links when the structure or location of a linked table has changed. 1. Open the database

Re: RE: Info Needed to Promote MySQL!! - Solved

2001-09-24 Thread David Turner
What I did to handle global changes was have one access file on the fileserver that everyone had a shortcut to. That way the updates were global since they were all to the same file. Dave On Mon, Sep 24, 2001 at 04:19:55PM -0600, Adam Douglas wrote: Another small research in Access made me to

Error Compiling mysql under Solaris

2001-09-05 Thread David Turner
Does anyone have a good configure statement I could try for making MYSQL on Solaris for Sparc? I've got it compiling on X86 but I get a parser error I've only seen mention of once on the lists, and I did not see how to identify the reserved word I am using? I'll continue digging around, but if

Re: Stored Procedures and Triggers

2001-09-03 Thread David Turner
A friend of mine mentioned something about perl stored procedures for MYSQL. Has anyone heard about this? I have searched everywhere and only seen posts related to POSTGRESQL. If they have this for MYSQL it would be really helpful. Thanks, Dave On Mon, Sep 03, 2001 at 01:37:23AM -0700, Jeremy

Re: Stored Procedures and Triggers

2001-09-03 Thread David Turner
Great thanks, I'll check it out. Dave On Mon, Sep 03, 2001 at 01:49:31PM -0700, Steve Edberg wrote: At 1:10 PM -0700 9/3/01, David Turner wrote: A friend of mine mentioned something about perl stored procedures for MYSQL. Has anyone heard about this? I have searched everywhere and only seen

Re: Berkeley or InnoDB?

2001-09-01 Thread David Turner
Can you explain this further? Dave On Sat, Sep 01, 2001 at 12:52:43PM +0400, Ilya Martynov wrote: AM I'm porting an application to MySQL and I need to support transactions. AM I will appreciate so much if someone could give me some impressions about AM which one is better. BerkeleyDB or

Re: Changing Database Location ?

2001-08-31 Thread David Turner
This is one thing I really can't stand about mysql. We should have the option when creating databases and tables of specifying where the database is located and the datafile and indexfile. Dave On Fri, Aug 31, 2001 at 07:03:40PM +0200, Simon J Mudd wrote: On Fri, 31 Aug 2001, Peter Moscatt

Re: Hot Backups

2001-08-30 Thread David Turner
for everyone's help. I now have a working backup script. -Original Message- From: David Turner [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 29, 2001 1:00 PM To: Joshua J. Kugler Cc: David Turner; Matthew Walker; MySQL Mailling List Subject: Re: Hot Backups Didn't read your

Re: multiple PRI indexes

2001-08-29 Thread David Turner
He may mean a composite primary key, which is a primary key based on two columns. On whether this is a good idea or not it's really a question of whether you want to use natural or surrogate keys on your tables. A composite key is typically a natural key. A natural key is a key with

Re: Hot Backups

2001-08-29 Thread David Turner
The way I am planning on doing it is setting up another server that I replicated to and backing that server up. I would like to hear how other people are backing up servers without interupting service. Dave On Wed, Aug 29, 2001 at 12:50:06PM -0600, Matthew Walker wrote: What's the best way of

Re: Hot Backups

2001-08-29 Thread David Turner
a table before it dumps, so there won't be any funny records. Or course, mysqldump could catch the database in the middle of a multi-table backup. But so can any live backup system. j- k- On Wednesday 29 August 2001 10:52, David Turner wrote: The way I am planning on doing

Re: Hot Backups

2001-08-29 Thread David Turner
in the middle of a multi-table backup. But so can any live backup system. j- k- On Wednesday 29 August 2001 10:52, David Turner wrote: The way I am planning on doing it is setting up another server that I replicated to and backing that server up. I would like to hear how other

Re: replace/insert into ... 150,000 -plus rows

2001-08-22 Thread David Turner
Besides that theoretical stuff, though, the real problem is that INSERT is for inserting new records into a database table. What you're trying to do is UPDATE existing records with new data. And there's no INSERT ... SELECT counterpart in the UPDATE syntax. What about replace? replace

Re: Failover

2001-08-21 Thread David Turner
Yes, that's probably where we'll end up. Thanks, Dave On Tue, Aug 21, 2001 at 03:28:51PM -0700, Jeremy Zawodny wrote: On Mon, Aug 20, 2001 at 01:21:22PM -0700, David Turner wrote: It looks like this will only run on Linux and I must either use Sparc Solaris or X86. I hate to implement

Re: Failover

2001-08-21 Thread David Turner
You would think this would get built into MYSQL though. Dave On Tue, Aug 21, 2001 at 03:28:51PM -0700, Jeremy Zawodny wrote: On Mon, Aug 20, 2001 at 01:21:22PM -0700, David Turner wrote: It looks like this will only run on Linux and I must either use Sparc Solaris or X86. I hate

Failover

2001-08-20 Thread David Turner
I have two identical primarily readonly databases that I want to be able to upgrade on the fly. What I want to be able to do is take one down and have all my connections redirected to the second database automatically. I would also like the same auto failover when a database crashes, because of

Re: Failover

2001-08-20 Thread David Turner
Great, thanks, Dave On Mon, Aug 20, 2001 at 01:04:10PM -0700, Jeremy Zawodny wrote: On Mon, Aug 20, 2001 at 09:28:20AM -0700, David Turner wrote: I have two identical primarily readonly databases that I want to be able to upgrade on the fly. What I want to be able to do is take one down

Re: Failover

2001-08-20 Thread David Turner
It looks like this will only run on Linux and I must either use Sparc Solaris or X86. I hate to implement the failover within the application. Thanks anyway, Dave On Mon, Aug 20, 2001 at 01:04:10PM -0700, Jeremy Zawodny wrote: On Mon, Aug 20, 2001 at 09:28:20AM -0700, David Turner wrote

Re: Help with a simple query ..

2001-08-20 Thread David Turner
Try this. I couldn't find if MYSQL supports not in's so I followed there outer joins. You can read up on in in the mysql manual, do a search on outer joins. select base.zipcode,properties.zipcode from base right join properties on base.zipcode=properties.zipcode where base.zipcode is null; On

Re: Downsides of MySQL?

2001-08-16 Thread David Turner
No offense but I've seen people on the list throwing replication around like MySQL has replication end of story. There's alot more to replication than just a master and a slave. What MySQL has is simple unidirectional replication. If you want advanced or bidirectional replication you'll have to