Re: [QUERY] Problem with Syntax/Query. Need Help Please.

2001-11-17 Thread Tore Van Grembergen
I don't now ich language you are using to perform this query. But as mysql does not know any stored procedures, you will have to do it in code with different call's. the value of the id (seed in mssql) can be obtained with the SQL function LAST_INSERT_ID() a little hint. in your stored procedur

Re: getting multiple columns per row from databse query

2001-11-15 Thread Tore Van Grembergen
the easiest way is using a counter to 4 and then do reset to so you get if counter = 4 then reset counter write new line endif % calculates the modulo between $i and 2 = Remainder of $i divided by 2 - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent:

Re: Easy SQL query??

2001-11-15 Thread Tore Van Grembergen
select max(storyID), storyCategoryID from newsStories where storyCategoryID > 0 group by storyCategoryID - Original Message - From: "Christopher Oson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, November 15, 2001 6:31 AM Subject: Easy SQL query?? > Good Day, All, > >

Re: how to do increments in parallel

2001-11-13 Thread Tore Van Grembergen
The solution is fairly easy. In you update statement you place something like this : update table set valuefield = newvalue where keyfield = key and valuefield = oldvalue after the update you check affected rows. if affected rows = 0 then it means that somebody else already changed the valuefiel

Re: Optimizing query (2nd attempt)

2001-10-28 Thread Tore Van Grembergen
rows The rows column indicates the number of rows MySQL believes it must examine to execute the query. - Original Message - From: "David Wolf" <[EMAIL PROTECTED]> To: "Tore Van Grembergen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Sunday

Re: Optimizing query (2nd attempt)

2001-10-28 Thread Tore Van Grembergen
maybe you heva to declare a compound index with userid and username. the sql parser now does not use the index on username. - Original Message - From: "David Wolf" <[EMAIL PROTECTED]> To: "Tore Van Grembergen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]&g

Re: Optimizing query (2nd attempt)

2001-10-28 Thread Tore Van Grembergen
do you have an index defined on users.username ? - Original Message - From: "David Wolf" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, October 28, 2001 4:26 PM Subject: Optimizing query (2nd attempt) > I have a query as follows: > > SELECT log.entity, log.action, > LEFT(u

Re: Making Foreign Keys within MySQL?

2001-10-26 Thread Tore Van Grembergen
you could dump the data in an .sql file (mysqldump) edit the .sql file to make the necessary changes import the .sql file - Original Message - From: "McGrotty, Charles" <[EMAIL PROTECTED]> To: "'Tore Van Grembergen'" <[EMAIL PROTECTED]> Sent

Re: Making Foreign Keys within MySQL?

2001-10-26 Thread Tore Van Grembergen
The only table type at this moment that supports foreign keys is innodb. it is distributed with mysql 4.0. However you need to take the source files or the tar file to instal, the rpm's have an older version of innodb. On creation of the table you have to define your constraints (cf manual at www

foreign keys and innodb

2001-10-24 Thread Tore Van Grembergen
Hi, if you want to enjoy the foreign keys from innodb in mysql 4 then you can't use binaries from the rpm files. The rpm files contain innodb .43, not .43b! But the source 4.0.0 and the .tar.gz binary 4.0.0 (non-rpm) contains .43b which supports foreign keys. Kind regards Tore --