Re: decimal type

2003-02-21 Thread Tore
= Balance - 265.50 WHERE AccountID = 999 AND Balance >= 265.50 This will affect 0 rows, which your code is smart enough to determine meaning "insufficient funds". So, the moral of this story is to use fixed precision numerical values to store information such as money... :

What is the most effective structure for tables and indexes in this case??

2003-07-29 Thread Tore Krudtaa
;; or select TheID from thekey where Keyword like 'theword'; Consider houndreds of thousands of records in table "thetable". QUESTION 2: Which of the two solutions will use less diskspace? _ Tore _

GRANT and REVOKE issue...

2003-09-09 Thread Tore Bostrup
NT DELETE, INSERT, SELECT, UPDATE ON TableY TO 'MyAdmin'@'%' identified by 'MyPwd' WITH GRANT OPTION; GRANT SELECT ON TableZ TO 'CL.Admin'@'%' IDENTIFIED BY 'CL.4d31n' WITH GRANT OPTION; FLUSH PRIVILEGES; Any ideas why this doesn't work as I expect it to? I couldn't find any related info in the MySQL doc'n. TIA, Tore. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

HELP - Permission denied with ODBC 3.51 - not with tools...

2003-09-15 Thread Tore Bostrup
se wide privileges Table Privilege to User table in mysql Db: SELECT Column Privileges to User column in User table in mysql Db: SELECT Column Privileges to Password column in User table in mysql Db: SELECT, UPDATE I am doing this to allow an application "administrator" to reset user passwords using my application. TIA, Tore.

Revoke User's Global Privileges?

2003-09-17 Thread Tore Bostrup
How does one go about revoking a user's GLOBAL privileges with a REVOKE statement? TIA, Tore

Another permission question...

2003-09-17 Thread Tore Bostrup
PDATE permissions on the mysql database didn't help either? TIA, Tore.

Re: INSERT ... SELECT - A slightly different question

2003-02-20 Thread Tore Bostrup
The typical syntax for this would be: INSERT INTO phone (personID, phoneNr, email, type) SELECT personID, '1-xxx-xxx-', \N, 'OFF' FROM persons WHERE lastName='' HTH, Tore. - Original Message - From: "Kyle Lange" <[EMAIL PROTECT

Re: Join or Group By?

2003-02-20 Thread Tore Bostrup
s column in the Links table corresponds to the SeriesID column in the Series table, you could write a query like: SELECT S.SeriesTitle, L.LinkTitle FROM Series as S INNER JOIN Links as L ON S.SeriesID = L.Series ORDER BY S.SeriesID, L.LinkID HTH, Tore. - Original Message - From: "

Re: PHP / MYSQL Question

2003-02-21 Thread Tore Bostrup
vious" value of Topic from the previous record, and only output the Topic part when it changes. HTH, Tore. - Original Message - From: "Mike Walth" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 21, 2003 5:34 AM Subject: PHP / MYSQL Question

Re: From Win2000/IIS to Linux/Apache ?

2003-02-21 Thread Tore Bostrup
erver). Regards, Tore. - Original Message - From: "Theisen, Gary" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 21, 2003 12:59 PM Subject: From Win2000/IIS to Linux/Apache ? > Hi all, > > I have PHP & MySQL installed on a Win200

Re: decimal type

2003-02-21 Thread Tore Bostrup
When you don't specify the precision for a DECIMAL column, it is assumed to be 0. This is documented in the previously posted link. create table pricelist (product varchar(45), cost dec(18, 2)) HTH, Tore. - Original Message - From: "Bryan Koschmann - GKT" <[EM

Re: decimal type

2003-02-21 Thread Tore Bostrup
t for situations where you really need to represent very small fractions or extremely large numbers with less than 100% accuracy, or for real number math application (engineering, science). Regards, Tore. - Original Message - From: "Stitchin'" <[EMAIL PROTECTED]> To

Re: Query syntax help?

2003-02-22 Thread Tore Bostrup
BY F.saveorder (another column) in this case, unless you include it (F.saveorder) in the SELECT and GROUP BY list. HTH, Tore. - Original Message - From: "Scott Brown" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, February 22, 2003 1:57 PM Subject: Query s

Re: Another Query Table Structure

2003-02-22 Thread Tore Bostrup
e information about normalization, check out http://www.15seconds.com/issue/020522.htm HTH, Tore. - Original Message - From: "Andrew Maynes" <[EMAIL PROTECTED]> To: "MySQL-Lista" <[EMAIL PROTECTED]> Sent: Saturday, February 22, 2003 3:13 PM Subject: An

Re: big table, slow queries...???

2003-02-22 Thread Tore Bostrup
in the query? Based on your description, it is hard to tell what you are really trying to do, and what would be the best way to do it. HTH, Tore. - Original Message - From: "Ferhat BINGOL" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>

Re: big table, slow queries...???

2003-02-22 Thread Tore Bostrup
different queries, the exact nature of those queries, etc., anything else would be guesswork. HTH, Tore. - Original Message - From: "Ferhat BINGOL" <[EMAIL PROTECTED]> To: "mysql" <[EMAIL PROTECTED]> Sent: Saturday, February 22, 2003 4:55 PM Subject

Re: Newbie - How To Link Two Databases

2003-02-22 Thread Tore Bostrup
' Or similarly, if you have the Address, and you want to show the Parcel Description: SELECT P.Description, B.Address FROM Parcels as P INNER JOIN Buildings a B ON P.dxf = B.dxf WHERE B.Address = '' HTH, Tore. - Original Message - From: "Diver8" <[

Re: Large table or several tables ?

2003-02-24 Thread Tore Bostrup
not. I would start out by using the logical grouping, and worry about partitioning the table(s) later - if required for performance. HTH, Tore. - Original Message - From: "gregory lefebvre" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 24,

Re: Unknown table in field list

2003-02-24 Thread Tore Bostrup
following (iuse table aliases for increased readability): SELECT P.DXF as 'record', B.address as 'results1', P.relname as 'results2' FROM parcels as P INNER JOIN building as B ON P.DXF = B.DXF WHERE P.relname LIKE '%jones%' ORDER B

Re: Directory structure

2003-02-24 Thread Tore Bostrup
odel would be better suited. HTH, Tore. - Original Message - From: "Adam de Zoete" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 24, 2003 12:46 PM Subject: Directory structure > Hi, > > I am trying to figure out the best method for creating

Re: # of Business Days?

2003-02-24 Thread Tore Bostrup
algorithm that generically describes your company's Holidays - and they never change...). Once you have that table, use a Count(*) on dates between a and b. HTH, Tore. - Original Message - From: "Lucas Cowgar" <[EMAIL PROTECTED]> To: "MySQL Mailing List" &

Re: Unknown table in field list

2003-02-24 Thread Tore Bostrup
fusion among people who have limited SQL experience). HTH, Tore. - Original Message - From: "Diver8" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 24, 2003 4:36 PM Subject: RE: Unknown table in field list > Jon and Tore, thanks so much for your k

Re: Select from multiple tables

2003-02-24 Thread Tore Bostrup
WHERE D.CompanyID = 36 HTH, Tore. - Original Message - From: "Frank de Bot" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 24, 2003 5:33 PM Subject: Select from multiple tables > Hi, > > I got the following query: > > SELECT *

Re: Help with a putting a slash into a record in mysql...

2003-02-24 Thread Tore Bostrup
Try prefixing the \ (the ***x escape character) with a \, i.e.: update test set f2 = 'c:\\temp' where f1 = 'location' HTH, Tore. - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 24, 2003 5:52 PM Subject: He

Re: Select based on related date

2003-02-24 Thread Tore Bostrup
ON S2.book_id = B2.id AND B2.date_purch >= DATE_ADD(CURRENT_DATE(), INTERVAL -6 MONTH) ) ON S2.subj = S.subj WHERE B2.id IS NULL Is there a restriction, quirk, or bug in MySQL that prevents parenthesised joins from working properly? HTH, Tore. - Original Message - From:

Re: mysql:Question about definition and index for performance

2003-02-25 Thread Tore Bostrup
queries use both key1 and acct together, you may consider hcreating all three indexes, or the composite index as well as the separate index for acct. HTH, Tore. - Original Message - From: "Vivian Wang" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, Febr

Re: Problem with MySQL, MyODBC, Access 2002 and Japanese.

2003-02-25 Thread Tore Bostrup
Don't know, but: Are you using the Japanese Access 2002? What locale is your OS configured for? HTH, Tore. - Original Message - From: "Juan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 25, 2003 6:12 AM Subject: Problem with MyS

Re: Reference to a downloadable file

2003-02-25 Thread Tore Bostrup
ZIPFile, and you have a rowset object $row, you would use something like: $DownloadURL = $row->ZIPFile; echo "Download Design"; for each line item. Of course you can use an img tag instead, but the principle is the same. HTH, Tore. - Original Message - From: "Stitchin&#

Re: index questions

2003-02-25 Thread Tore Bostrup
port/ta001.html. I have been unable to verify whether the CHECK constraint is actually implemented with any table types or in any versions of MySQL. HTH, Tore. - Original Message - From: "Sheryl Canter" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday,

Re: index questions

2003-02-26 Thread Tore Bostrup
sword: You at least *document* the *intent* that way, but if anyone sees the declaration and expects it to do something, they could be in for a surprise. Regards, Tore. - Original Message - From: "Sheryl Canter" <[EMAIL PROTECTED]> To: "Tore Bostrup" <

Re: Help needed with SQL...

2003-02-26 Thread Tore Bostrup
belonging to the same group (set two). And the two "instances" of the table have to be identified through use of table aliases. Regards, Tore. - Original Message - From: "Sheryl Canter" <[EMAIL PROTECTED]> To: "Don Read" <[EMAIL PROTECTED]>;

Re: Column Type help

2003-02-26 Thread Tore Bostrup
o I'd probably go with the LONGTEXT, too. HTH, Tore. - Original Message - From: "Tom Ray" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 26, 2003 11:28 AM Subject: Column Type help > Hey there, I'm kinda new to using mysql to

Re: Random 32bit number for columns?

2003-02-26 Thread Tore Bostrup
I assume the RAND() function can be used in in an insert: INSERT INTO target (MyRandVal, OtherColumns) VALUES (RAND() * (MaxVal - MinVal) + MinVal, OtherData) OR INSERT INTO target (MyRandVal, OtherColumns) SELECT RAND() * (MaxVal - MinVal) + MinVal, OtherData FROM ... HTH, Tore

Re: I'm not sure if this is HTML question or PHP...

2003-02-27 Thread Tore Bostrup
The technique you are looking for is usually referred to as "recordset paging". A Google search for PHP Recordset Paging brought back a slew of hits. Find one that appeals to you/explains what it does so you can use it. HTH, Tore. - Original Message - From: "Sti

Re: Inner join question!

2003-02-27 Thread Tore Bostrup
A.date, num1, num2, A.time HAVING Count(*) > 1 SELECT B.date, num1, num2, B.time, Count(*) FROM B GROUP BY B.date, num1, num2, B.time HAVING Count(*) > 1 HTH, Tore. - Original Message - From: "Ramesh Pillai" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Th

Re: SELECT DISTINCT question

2003-02-27 Thread Tore Bostrup
astName FROM authors as A INNER JOIN royalties as R ON A.AuthorID = R.AuthorID INNER JOIN tmproymax as RM ON R.ProgramID = RM.ProgramID AND R.Royalty = RM.Royalty; HTH, Tore. - Original Message - From: "Sheryl Canter" <[EMAIL PROTECTED]>

Re: SELECT DISTINCT question

2003-02-28 Thread Tore Bostrup
at an INNER JOIN differently from a join in the WHERE clause - I don't know how the MySQL optimizer works. Regards, Tore. - Original Message - From: "Sheryl Canter" <[EMAIL PROTECTED]> To: "Tore Bostrup" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sen

Re: query or php with a join

2003-02-28 Thread Tore Bostrup
query as above to make it easire to read. For the same reason, I also prefer to use table aliases. With short table names like items and city, this is not a big deal, but when the table names get longer, the query can get obscured by the prefixes. HTH, Tore - Original Message - From: "

Re: mysql: change column to row

2003-02-28 Thread Tore Bostrup
Google hits for searches on MySQL Crosstab, etc. HTH, Tore. - Original Message - From: "Vivian Wang" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 28, 2003 10:29 AM Subject: mysql: change column to row > mysql, > > Can I change the table

Re: SELECT DISTINCT question

2003-02-28 Thread Tore Bostrup
x, y, z Form Table is equivalent with SELECT x, y, z FROM Table GROUP BY x, y, z HTH, Tore. - Original Message - From: "Sheryl Canter" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; "Frank Peavy" <[EMAIL PROTECTED]> Sent: Friday, February 28, 2003

Re: update question

2003-03-01 Thread Tore Bostrup
ATE mytable SET mydatestr = LEFT(mydatestr, LENGTH(mydatestr) - 3) WHERE mydatestr LIKE '__-__-__-__' HTH, Tore. - Original Message - From: "chip wiegand" <[EMAIL PROTECTED]> To: "mysql" <[EMAIL PROTECTED]> Sent: Sunday, March 02, 2003 1:46 AM Subject

Re: Using SUM in a select statement.

2003-03-02 Thread Tore Bostrup
'll either have to use two separate queries or calculate the totals in your app from the detail data. HTH, Tore. - Original Message - From: "C. Reeve" <[EMAIL PROTECTED]> To: "MySQL List" <[EMAIL PROTECTED]> Sent: Sunday, March 02, 2003 11:54 AM Subjec

Re: update question

2003-03-02 Thread Tore Bostrup
dard syntax and a good description of the key things you need to know for writing SQL queries. You'll still need to check the MySQL documentation to find out what is/isn't supported, what differes froim the standard, and what specific functions are available, etc. HTH, Tore. - Or

Re: Duplicate

2003-03-02 Thread Tore Bostrup
Simply create a UNIQUE Index on the column to avoid duplicates. That will be case insensitive, and trailing spaces AFAIK, but spaces inside the columns text have significance. HTH, Tore. - Original Message - From: "Dee" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>

Re: Perplexed by reverse SELECT statement.

2003-03-04 Thread Tore Bostrup
E '$UserID,%' OR readBy LIKE '%,$UserID' OR readBy LIKE '%,$UserID,%'" You need to look for the three situations to avoid matching the wrong entries in for example (11,20) (5,11) or (5,11,20). HTH, Tore - Original Message - From: "Rich Hutchins

Re: Reshuffling unique integers

2003-03-04 Thread Tore Bostrup
Allow negative values in the column (but don't use them). When modifying the values, give them their correct numeric value but make them negative. Then update the negative values to positive. HTH, Tore. - Original Message - From: "Amittai Aviram" <[EMAIL PROTECTED]>

Re: HAVING vs. WHERE

2003-03-05 Thread Tore Bostrup
to use HAVING would be to show values that have duplicate entries in the database: SELECT FirstName, LastName, Count(*) FROM MyTable GROUP BY FirstName, LastName HAVING Count(*) > 1 HTH, Tore. - Original Message - From: "Jonathan Arnold" <[EMAIL PROTECTED]> To: <[

make_set and grouping

2002-10-31 Thread tore . eriksson
labels (or all lables for bit_and). The make_set() function seems to clobber the internal grouping function bit_or(), or is there some other reason this construct is illegal? Tore (using MySQL 4.0.3-beta on Tru64 UNIX)

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

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

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: 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: 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
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: 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: 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: 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: [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