Re: --- How to query results of a query?

2003-01-15 Thread greg55

If you're in Java you can call getMetaData on the ResultSet, and then call methods on 
that (ResultSetMetaData) to determine number of columns, and type of each column.

This avoids the steps of creating/deleting a temp table.

What language are you using?

 
 From: Will Standley [EMAIL PROTECTED]
 Subject: --- How to query results of a query?
 Date: 16/01/2003 6:42:05
 To: [EMAIL PROTECTED]
 
 How do you query the table that is the results of a query?
 
 Must you ask MySQL to...
 ...create a temporary table form the results of the first query
 ...then query that temporary table
 ...then delete the temp table when you are done?
 
 (and if so how do you ask MySQL to create a temp table from the results of a
 query?)
 
 Is there a better and faster way to do this with minimum burden on the web
 server with the db on it?
 
 Thanks for any help.
 
 Will
 
 
 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)
 
 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 
 

This message was sent through MyMail http://www.mymail.com.au



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: innofb foreign keys problem

2003-01-14 Thread greg55
yes -- you need to create indexes on foreign key colums.

it would be better if one of the following 2 things happened instead.

1. foreign key creation failed if no index existed.
2. indexes were created automatically

it's more dangerous than actually not having foreign keys as it stands since it's easy 
to *think* your app is working correctly when it could in fact be trashing referential 
integrity.

 
 From: Natale Babbo [EMAIL PROTECTED]
 Subject: innofb foreign keys problem
 Date: 15/01/2003 2:41:06
 To: [EMAIL PROTECTED]
 
 # - 3rd post - #
 # - PLEASE HELP -- #
 
 hi to all,
 
 is it still true that mysql/innodb needs explicit
 index creation on foreign keys?
 why can't i use a standard syntax for foreign keys
 creations?
 i have a database schema (ddl) with over 50 tables and
 i was trying to create the database on mysql when i
 receive a lot of errors like this:
 
 ERROR 1005: Can't create table  (errno 150)
 
 how can i create the database without creating
 explicitly an index on each foreign keys of my
 database?
 
 any suggestions are appreciated.
 thanks to all.
 
 __
 Yahoo! Cellulari: loghi, suonerie, picture message per il tuo telefonino
 http://it.yahoo.com/mail_it/foot/?http://it.mobile.yahoo.com/index2002.html
 
 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)
 
 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 
 

This message was sent through MyMail http://www.mymail.com.au



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: subselects

2003-01-02 Thread greg55

How's your application written? i.e. J2EE?

We've managed to put a layer in between the application and MySql that translates 
subselects on the fly into inner joins.

This allowed us to quite painlessly move from MS SQL to MySql.

EXISTS can be refactored into an inner join.
NOT EXISTS can be refactored into an outer join with test for null on an outer 
joined column.

Of course we'll rip this layer out when subselects are available but the tradeoff is 
we don't have to spend $10K per server for licensing, and even with this translation 
layer in, it's still faster than MS SQL.

Greg

 
 From: Ahmed Farouk [EMAIL PROTECTED]
 Subject: subselects
 Date: 03/01/2003 6:01:00
 To: [EMAIL PROTECTED]
 
 Hi All
 I know that this maybe a repeated question here but I just need to know
 the updates.
 I am asking about the new feature of subselects which should be implemented
 in version 4.1 (thats what i know), when this version is expected to the
 light ?
 
 For me this single feature (subselect) will enable our company to transfer
 many applications from Oracle to MySQL and I think the same holds for many
 people out there so we are really eager to see it working.
 
 
 Thanks
 Ahmed Farouk
 
 
 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)
 
 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 
 

This message was sent through MyMail http://www.mymail.com.au



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Re: Trouble converting SQL from Access

2003-01-02 Thread greg55
we did something like this a while back.

i remember we AND'ed what you basically have now with a number of less than and 
greater than expressions to box the circle that you describe in your statement.

this boxing of the area merely provided a way to quickly limit the number of rows 
against which the sqrt(pow... stuff could limit down further into a circle.

the , , expressions could use indexes whereas the sqrt/pow stuff can't.

greg.
 
 From: Leo G. Divingracia III [EMAIL PROTECTED]
 Subject: Re: Trouble converting SQL from Access
 Date: 03/01/2003 13:08:57
 To: Asendorf John [EMAIL PROTECTED]
 CC: [EMAIL PROTECTED],   [EMAIL PROTECTED]
 
 Asendorf, John wrote:
 .
  
  SELECT Dealers.*, SQRT(POW((2285-Zips.North),2)+POW((4760-Zips.West),2)) AS
  Distance
  FROM Dealers 
  INNER JOIN Zips ON Dealers.Zip = Zips.Zip
  ORDER BY POW((2285-Zips.North),2)+POW((4760-Zips.West)),2)
  
  Any suggestions to speed this guy up? 
 
 yeah, do you really need ALL the columns returned?
 
 also, if you can, offload the calculations to PHP*, like the POW() 
 function...
 
 
 grab the data from MYSQL and then use PHP to do the calcs...*
 
 
 -- 
 Leo G. Divinagracia III
 [EMAIL PROTECTED]
 
 z
 
 
 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)
 
 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 
 

This message was sent through MyMail http://www.mymail.com.au



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php