Dear all,
I am wondering whether constant arguments are required in string functions, e.g.
Substring(str, pos, len).
Given MyTable:
...
MyString TEXT,(muti-byte characters)
MyPos UNSIGNED(10),
MyLength UNSIGNED(10).
While (1) wor
All,
I tried to use
SELECT MAX(COUNT(*))
FROM ...
GROUP BY ...
in MySQL. But an error occured: Invalid use of group function.
Is it necessary to create a temporary table to store the COUNT(*) results, and then
get the MAX from it?
How to write this sql?
I have a table:
Date |Low High
--
...
28 |17
-
29 |17
29 |23
29 |410
30 |17
30 |2
Dear all,
I intend to write a large volume of records to a table tbl.
tbl:
fld1, int unsigned not null auto_increment primary key,
fld2, text
fld3, text
The combination of (fld2, fld3) should be be unique, so I need to check for duplicates
every time when a record is added.
-->Question1: How
A table T contains two fields: T.ID, T.Data.
I want to set its T.Data to one of three values: NULL, 0, 1 according to its T.ID.
This is what I have done:
1. Set all Data to be NULL:
UPDATE T SET Data = NULL;
2. Create a temporary table Temp to store some selected T.ID. Then update the Data of
I use MySQL 3.23.
Dear all,
Which records in tbl1 are to be updated are determined by an INNER JOIN with tbl2. I
have tried the following:
UPDATE tbl1 INNER JOIN tbl2 ON tbl1.id = tbl2.id
SET tbl1.col1 = 0;
UPDATE tbl1, tbl2
SET tbl1.col1 = 0
WHERE tbl1.id = tbl2.id;
UPDATE tbl1
SET tbl1.col1 = 0
INNER JOIN tb
Dear all,
I intend to write a query to select rows based on the results from another query:
SELECT * FROM tbl1 WHERE coln1 IN (SELECT DISTINCT coln2 FROM tbl2);
But this one does not work in MySQL. Anyone could help me to figure out this problem?
Thanks a lot.
Dear all,
A table "book" looks like this:
"page" "content"
--
1 abc
1 de
2 fgh
3 ijk
3 lmn
3 opq
...
210 z
I need a query to randomly select 90% of all pages and their
corresponding contents.
I have written the following querys. But I have pr