Re: mac() from a subset

2006-03-29 Thread Sandy
I have found the answer select max(greatest(f1,f2,f3 .)) from table "Sandy" <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] > Hi > > > select max(f1) as nf1 , max(f2) as nf2, max(f3) as nf3, max(f4) as nf4 > from table > >

mac() from a subset

2006-03-28 Thread Sandy
Hi select max(f1) as nf1 , max(f2) as nf2, max(f3) as nf3, max(f4) as nf4 from table How can I extract a max value from the 4 columns of the result ? ex: greatest(nf1,nf2,nf3,nf4) Thanks -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:ht

Re: Li'l problem with count()

2006-03-28 Thread Sandy
Hi Jay I just tried your code but I used $foo=mysql_fetch_object($result) and returned $foo->flyCount. It works the same as your code. (I actually have 738 flies in my pot, it's a crowd, and a lot of proteins !!! ;-) ). What method is heavier on the MySQL engine ? count() is said to be the f

Re: Li'l problem with count()

2006-03-28 Thread Sandy
thanks Because $result is a resource in PHP, not the actual result of the query; $foo = mysql_num_rows($result); -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Li'l problem with count()

2006-03-28 Thread Sandy
Hi Flies in pot = function flies(){ $sql = 'select count(*) from flies'; $lnk = mysql_connect('localhost','root','123456'); $db = mysql_select_db('moar',$lnk); $result = mysql_query($sql,$lnk); mysql_free_result($result); mysql_close($lnk); return $result; } Why this leads to 'ressource id

Re: include a field from a table into another table

2005-12-19 Thread Sandy
Hi Shawn, > > I have never tried any of the NATURAL joins so your results were very > interesting to me. The order in which the rows were joined provides you > with some insight about how the engine actually performs the joins (which > table is in the outer loop and which is in the inner loop). *w

Re: include a field from a table into another table

2005-12-19 Thread Sandy
LEFT, RIGHT, or CROSS join, the So (A) INNER JOIN (C) is (B) ( A int C ). Can you explain what are the other JOINs (CROSS, NATURAL, OUTER etc) ? Sandy -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: include a field from a table into another table

2005-12-19 Thread Sandy
tersect) RIGHT CIRCLE) Actually LEFT JOIN depends on the left part of the predicate : select A , C from A left join C represents A + A int C (B) and select C, A from C left join C represents C + C int A (B) and select C , A from A left join C represents A + C int A (B) but the columns of C pr

Re: include a field from a table into another table

2005-12-19 Thread Sandy
A on 1=1 is equivalent as select A.*, B.* from A left join B on 1=1 Sandy -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: include a field from a table into another table

2005-12-18 Thread Sandy
? Could you esplain these terms a bit to me please ? I think these terms are the most ambigous to the beginners like me. I read the documentation but I'm not sure I understand it very well. Thanks Sandy > Here is how I prefer to write the query you wrote (using an explicit JOIN) > >

include a field from a table into another table

2005-12-17 Thread Sandy
Hi I have the following tables: CREATE TABLE `livres`( `id` int(10) unsigned NOT NULL auto_increment, `isbn` varchar(12) NOT NULL default '', 'titre' varchar(80) NOT NULL default '', `auteur` int(10) unsigned NOT NULL default '0', `categorie` varchar(60) NOT NULL default '', PRIMARY KEY (

Any way to pass variables into a SQL script???

2001-04-06 Thread Sandy Lewis
re set as &1 and &2 Can this be done using mySQL?? Thanks for any help. Sandy Lewis Avant! - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (t