= 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... :
;;
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
_
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]
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.
How does one go about revoking a user's GLOBAL privileges with a REVOKE statement?
TIA,
Tore
PDATE permissions on the mysql database didn't help either?
TIA,
Tore.
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
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: "
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
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
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
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
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
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
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]>
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
'
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" <[
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,
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
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
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" &
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
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 *
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
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:
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
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
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
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,
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" <
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]>;
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
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
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
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
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]>
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
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: "
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
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
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
'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
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
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]>
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
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]>
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: <[
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)
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
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
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
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
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
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
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
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,
>
>
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:
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
58 matches
Mail list logo