MySQL will not use the primary key unless you use the left most columns. For
a 1 column primary key then it's easy. For a 2 column primary key you can
either use the 1st column in the primary key or both columns. If you only
reference the 2nd column the query will not use the primary key and wil
Try this
SELECT c.account_id,
a.name,a.company,
SUM(c.agent_product_time) AS mins
FROM account a
LEFT JOIN calls c
ON c.account_id = a.id
WHERE c.calldate >= DATE_SUB(NOW(),INTERVAL 14 DAY)
AND c.agent_id = 9
GROUP BY a.account_id
HAVING SUM(c.agent_pr
And now we are down to reality. This is a MySQL list. Views are a wonderful
thing for creating an isolation layer between the application and the
database. However, MySQL's current implementation makes it extremely
difficult in many cases to avoid full table scans when you define the
logical view.
What you are looking for is the INFORMATION_SCHEMA views, but they are not
available before 5.0. Until then you have to parse the "show create table"
or "DESCRIBE tablename" may be easier to parse
mysql> describe organizations;
+---+
Have you tried Repair table or if InnoDB
ALTER TABLE ENGINE=InnoDB;
Sometimes I've noticed after a restore or after adding lots of rows
performance is slow. REPAIR or the ALTER TABLE fixes it.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, March 17,
If "%20" are the actual characters in the varchar column you shuld be able
to do
UPDATE table
SETcolumn_name =REPLACE(column_name,'%20',' ');
You might have to use REPLACE(column_name,'\%20',' ');
to force MySQL to treat "%" as an actual value instead of a wild card.
-Original Message-
We are running 2.6.15-gentoo Linux and downloaded the max binaries for
5.1.7. With the following my.cnf I thought we should have InnoDB. All of the
InnoDB files got created but show variables like 'have%'; displays "
have_innodb DISABLED". Exactly the same my.cnf {except the skip bdb is not
commen
If the features available in stored procedures {i.e. looping etc.} are
required, have you tried having the procedure 1st write/edit the data in a
temporary table and at the end select the values you want from that table.
I think I might write 2 procedures. One that does the data manipulation an
I have been linking MySQL tables into access for versions 3.23 thorough
5.17. The only way I have been able to deal with insert/update tables with a
timestamp field is to build a query which includes all of the fields except
the timestamp field. You can then do your insert or update against the
que
REMOVE the semicolon ";" from " END;//"
SQLyog has a problem with all of the procedures, functions and triggers RE
the DELIMITER syntax.
> -Original Message-
> From: Daevid Vincent [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 11, 2006 10:00 PM
> To: mysql@lists.mysql.com
> Cc: 'Shawn
I think you can also do
SELECT *,
DATE_FORMAT(deadline, '%d-%m-%Y') AS deadline_f,
Status + 0 AS sorted_grade
FROM v_issue_project_task
ORDER BY sorted_grade
That way you do not have to change the code if you add a value t
Just one suggestion re the behavior of special characters between file
input and command line input. Try using char(10) {I think that is new
line} instead of \n. That should work in both scenerios.
-Original Message-
From: John Kebbel [mailto:[EMAIL PROTECTED]
Sent: Saturday, April 28, 20
Try something like this. If there are multiple punctuation values you
want to ignore you can nest multiple REPLACE functions.
mysql> create table names (name varchar(20));
Query OK, 0 rows affected (0.01 sec)
mysql> insert into names values
('Osbourn'),("O'shea"),("O'Malley"),('Olathe'),('Ottawa
I tried running this load data command on Server version: 5.0.27 and get the
1148 error. I'm not sure if it is referring tho the comand client or the
server.
I also do not understand why the command {or which part} it is complaining
about. Probably something obvious, but I just can't see it.
A
Try this
Select *
from resources, goals
where resources.ID = goals.RESOURCE_ID
and (SUBJECT="English"
and GRADE="1")
OR
(SUBJECT="English"
and GRADE="2");
-Original Message-
From: AM Thomas [mailto:[EMAIL PROTECTED]
Sent: Sunda
Did you want
WHERE Name LIKE 'sandy'
OR (main_data.Display_In_Search = 1
AND main_data.Expiry_Date >= CurDate())
OR
WHERE main_data.Expiry_Date >= CurDate()
AND (Name LIKE 'sandy'
OR main_data.Display_In_Search = 1 )
-Original Message
This works if you don't care about holidays.
If you do the only solution that I have seen that works is to create a
business day table. Ours is shown below. You have to hand construct the
calendar by removing weekends and holidays for the specific entity. This
calendar forces a non business day DA
This reminded me of one more difference between Windows and Linux/Unix.
MySQL use the round function out of the host libraries. If you are on a
Windows box the rule for rounding is if the column immediately to the right
of the column you are rounding to is a 5 then round up
i.e. make 2.485 >>>
I have > 200 tables with regular datetime fields. I link these tables
through ODBC to an ACCESS database where I can run standard ACCESS append
queries or even copy/paste append into the linked table. ODBC handles the
conversion just fine.
One caution, MySQL timestamp maps to ACCESS datetime but
If Publisher XP's mail merge can find data in ACCESS try linking the tables
into an ACCESS database and then tying Publisher to the ACCESS database.
Sounds klunky but it might work.
-Original Message-
From: GH [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 08, 2005 9:37 AM
To: J.R. Bulli
The key to your question is InnoDB. InnoDB keeps data and indexes in its
buffer using LRU to flush. So the 2nd time your data was already in memory.
Depending on your buffer size and database size you have all of the
advantages of a memory resident database for frequently used data
without the dis
You can do left joins in an update.
mysql> show create table t;
+---+---
--
| Table | Create Table
+---+---
--
| t | CREATE TABLE `t` (
`key1` int(1
As long as articles.annotationID can be made distinct from
names.annotationID why not use 2 left joins.
You may have to test annotationType in the select section to map the fields.
Something like the following.
SELECT elements.annotationID,
CASE annotationType
WHEN 'names' T
One way would be to build a "count" table with one column starting with
value 1 and incrementing by 1 up to say 500 rows or how many your max y
value is. Then just
select seq,val from wibble,count where val between x and y
create table count (val INT unsigned default '0' not null primary key)
I have been using ACCESS to do simpe data editing on our MySQL tables for 3
years.
I recently installed 5.0.4 on my machine to evaluate it. I linked the tables
into ACCESS through my old ODBC driver and got
ODBC-update on a linked table 'product_order_choice' failed
[Microsoft][ODBC Driv
(14) NOT NULL,
`poch_Create` datetime NOT NULL default '-00-00 00:00:00',
PRIMARY KEY
(`cpny_ID`,`prod_ID`,`porc_Look_Up_Type`,`prft_Sub_Month`,`prft_Sub_Item`,`p
och_Name`)
) TYPE=InnoDB |
---+
1 row in set (0.00 sec)
mysql>
-Original Message---
> Has anyone else seen this or have any ideas?
>
"Gordon" <[EMAIL PROTECTED]> wrote:
--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
__ ___ ___ __
/ |/ /_ __/ __/ __
If you can add a table structure why not create a SELECTED table with REPORT
ID and PERSON ID as the 2 field PRIMARY KEY.
Then you could INSERT IGNORE into this table [with no BEGN/COMMIT] and the
IGNORE would throw away those already selected.
-Original Message-
From: Duncan Hill [mailto
I was all set to tell you why 16.125 became 16.12 when I ran the test on our
production box. It looks like some where between 4.0.20 and 5.0.4 the ALTER
TABLE to a decimal data type changed from truncation to rounding.
Redhat MySQL 4.0.20 truncates all
Windows XP MySQL 5.0.4 Rounds with Windows a
You probably want to add type to both the address and phone tables. Then you
can be selective in your reporting and still get 1 row per student in your
result set. Just remember if your data has the possibility of not having the
information for a student you want to use LEFT JOIN's vs INNER JOIN's
The folowing is out of the current MySQL manual. It looks like you could
create an intermediate table with the fields you are interested in the front
and "garbage" fields on the end. Then build a specific LOAD DATA INFILE with
correct mapping for each file type [assuming you can tell this in your
a
IF GroupID, HostID and UserID are unique between the three sets then your
GroupMember table will work although I would still be tempted to add a
MemberType in the GroupMember table.
Isn't MemberID the Foreign Key to UserID/HostID/GroupID althugh I don't know
if you can have three different foreig
If you just dump the structure with mysqldump and then build
SELECT INTO OUTFILE and LOAD DATA INFILE
statements for each table, the process will run faster than even the
"extended insert" option of mysqldump.
-Original Message-
From: ManojW [mailto:[EMAIL PROTECTED]
Se
If you want to change the value in qid to 3 when it is 0
You really need an update
update answer
setqid = 3
where qid = 0
-Original Message-
From: ÇÈæ ÇÈÑÇåíã [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 8:14 AM
To: [EMAIL PROTECTED]
Subject: copy from table to it
We have 2 tables which are roughly half the size of the entire database
{ ~1.5GB}. These 2 tables are rarely changed {1-2 times a quarter}.
Is there a way in mysqldump to exclude these two tables without
specifically naming all of the tables { > 100} we want to include?
I just installed MySQL 5.0 on my windows machine and was trying to load
the output from a MySQLFront export from our 4.0.16 production system
when I got the following error..
C:\>mysql -u root mailprint < e:\mp20040205.sql
ERROR 1062 at line 7893168: Duplicate entry 'Name-4928 N Brooklyn
Kansas
Sorry for the repost, but I just realized that the index information for
key 3 did not get copied into the 1st email.
-Original Message-
From: Gordon [mailto:[EMAIL PROTECTED]
Sent: Monday, February 09, 2004 8:48 AM
To: [EMAIL PROTECTED]
Subject: non unique index on MySQL 5.0
I just
It is possible if you make the number of digits in day all the same by
using something like lpad.
The secret is to tie all of the values you want together with something
like CONCAT and making sure that
the resulting string sorts in the order you want with its alphabetic
sort sequence. Then MAX gi
I have 2 tables t and t1. In this case, t1 is a copy of t. I want to
delete rows from t1 based on criteria on the t table and a relationship
between t ad t1 (in this case the id column). In the results below, I
would think that the delete should have deleted row 1 {1 5 me) and not
row 3 (1 5 th
Is it possible to run 3.23.43 and 4.0.13 on the same server?
I don't see anything in the documentation that should prohibit this as
long as the installations are in different directories, use different
sockets/ports and data directories.
Can this be done utilizing mysqld_multi and if so are ther
You might also try
FROM table_a
INNER JOIN table_b
ON table_b.code = substring_index(table_a.code,';',1)
SUBSTRING_INDEX(str,delim,count)
Returns the substring from string str before count occurrences of the
delimiter delim. If count is positive, everything to the left of the final
deli
This may not be elegant, but why not define a 3rd table proj_c containing
proj and project_rsrc. This assumes that when you define a project you know
how many resources are required.
CREATE TABLE proj_c (
proj varchar(11) default NULL,
project_rsrc INT default 0);
INSERT INTO proj_c
VALU
Try something like this
SELECT A1.ID,
SUM(IF(ISNULL(C.AdID),0,1)) AS Clicks,
SUM(IF(ISNULL(V.AdID),0,1)) AS Views
FROM Ads A1
LEFT JOIN Clicks C
ON A1.ID = C.AdID
LEFT JOIN Views V
ON A1.ID = V.AdID
GROUP BY A1.ID
-Original Message-
From:
Try this.
The second set ... select gives you what you want.
However, the group by may interfere with the rest of your logic. You also
don't really need the mod(@a,2) in the result set, just in the having.
mysql> set @a:=0;
Query OK, 0 rows affected (0.00 sec)
mysql> select @a:[EMAIL PROTECTED],m
Try SELECT SUBSTRING(AnimalName, 1, 1)
MySQL wants the "(" to immediately follow the function i.e. no spaces.
-Original Message-
From: Sue Cram [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 03, 2005 9:28 AM
To: mysql@lists.mysql.com
Subject: Syntax Failures with SELECT SUBSTRING - H
We have built an alternative save restore process. First we take all of the
.frm files and build
"select * into outfile '/path/tablename.txt' from tablename"
statements. We also dump the structure only and put it in the same
directory. This runs much faster than myysqldump and every t
It is my understanding that at least through 4.0.14, INNODB does not
support using autoincrement on the last field in a multi field primary
key.
i.e. if a table has a primary key of three fields like
cpny_ID, acct_ID, list_ID
in MYISAM you can add the autoincrement attribute to list_I
We are running MySQL 4.0.14 on redhat 8.0.
The server and MySQL have been running fine for over 60 days.
Sometime yesterday afternoon the time reported in mysql using
mysql> select now();
+-+
| now() |
+-+
| 2003-10-31 20:22:36 |
+---
What about making the table INNODB? If you make INNODB's buffer large
enough, the high activity data/index blocks are retained in memory.
INNODB's non blocking read and single statement transaction default
should make the "transaction overhead" minimal and INNODB doesn't have
any of the HEAP table
A few weeks ago I download the windows version for 5.0.0 and installed
it on my machine. After successfully installing the new version I was
able to connect with all of my old tools including MyCC 0.9.3,
MySQLFront, SQLyog, cmd and MySQL Administrator.
Yesterday I downloaded the 5.0.0 RPM's for l
Has anyone out there written a Credit Card Validation routine as a
user-definable function (UDF)?
We now have a requirement to collect credit card data through our Web
Site.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com
DID DELETE FROM XXX with no where clause stop acting like truncate in
4.0.5?
In 3.23.51 and earlier versions of 4.0.x
mysql> delete from product_order_main;
GIVES THIS
Query OK, 0 rows affected (0.10 sec)
AND RESETS THE AUTOINCREMENT VALUE
mysql> insert into product_order_main values
(
8','IN',NULL,'A',NULL,'bc35afd157ffa6c8729557a6fb62810d','gordonb','2003-01-20
17:12:25',234,'Y');
INSERT INTO dns_rec VALUES
('00105a3bcac286c9f9487dfe896ad220','0b','IN',NULL,'A',NULL,
if
end if
I built an Excel spreadsheet and the "regular" round routine introduced
a 10 times larger round error than the one above on ~200 values.
Gordon
Interstate Software
A MySQL training partner
-
Before posting,
Two of my co-workers attended the MySQL training in San Francisco last
month. We have successfully installed 4.01 on a SUN Ultra 250 running
Solaris 2.8. Four myisam tables were created and populated. When we
tried
to install the same software on a SUN Sparc 20 running Solaris 2.6
errors
were
data/ENUM relationships for any values already in the table
which fall after the value in the list which you removed.
Either just add another table and do joins or live with only being to
add to the list.
Gordon Bruce
Interstate Software
A MySQL Training Partner
> -Original Message-
&
QUICK] FROM table_name
[WHERE where_definition]
[ORDER BY ...]
[LIMIT rows]
or
DELETE [LOW_PRIORITY | QUICK] table_name[.*] [table_name[.*] ...] FROM
table-references [WHERE where_definition]
Gordon Bruce
Interstate Software
A MySQL Training Partner
> -Original Message-
>
1.5 |
|4 | 5.0990463257 |
|5 | -1.7971389771 |
+--+---+
4 rows in set (0.00 sec)
Gordon Bruce
A US MySQL Training Partner
> -Original Message-
> From: Nissim Lugasy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 24, 2002 2:57 PM
> To: [
e details below
Gordon Bruce
Interstate Software
A MySQL US Training Partner
mysql> create table g_mean (test_val float);
Query OK, 0 rows affected (0.02 sec)
mysql> insert into g_mean values (23),(32),(12),(145),(18);
Query OK, 5 rows affected (0.00 sec)
Records: 5 Duplicates:
PPEND query to copy the Access tables into the MySQL
tables
Delete the Access database after verifying success
Moving the dates through the ODBC interface automatically converts the
DD-MM- format to the -MM-DD format used by MySQL.
Gordon Bruce
Interstate Software
US MySQL Training P
gits or you can add 0's on the end
of your 5 digit ZIP's with RPAD().
Gordon Bruce
Interstate Software
A MySQL Training & Consulting Partner
> -Original Message-
> From: Jan Peuker [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 22, 2002 12:54 PM
> To: Gurhan Ozen
with
MyISAMPACK and MERGE could make queries against on the whole data set
run much faster.
Gordon Bruce
Interstate Software
A MySQL Training & Consulting Partner
> -Original Message-
> From: Daren [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 23, 2002 4:45 AM
> To: [EM
Try round(value*4,0)/4
Worked on the samples I tried
> -Original Message-
> From: Nicholas Stuart [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 23, 2002 1:47 PM
> To: [EMAIL PROTECTED]
> Subject: rounding?!
>
> Ok here's the problem. Trying to write a select statement to be able
to
>
If you use IGNORE in the insert IGNORE into new_table you will get the
result you want.
> -Original Message-
> From: walt [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 30, 2002 3:11 PM
> To: David Kramer; [EMAIL PROTECTED]
> Subject: Re: removing duplicate records
>
> Thanks David!
>
The following SELECT should produce your table
mysql> Select id,
->Max(CASE TimeSlot
-> WHEN 1 THEN Subject
->ELSE ""
->END) AS TS1,
->Max(CASE TimeSlot
-> WHEN 2 THEN Subject
->ELSE ""
-
There is a program at http://www.convert-in.com/acc2sqlp.htm which will
create the MySQL tables from the Access 2000 database and populates
created tables directly from the Access 2000 source. It also converts
date/datetime fields into MySQL format and Yes/No fields into tinyint.
The best news is
This is an example from MySQL's class on Using MySQL
MySQL> Select Name
-> From Country
-> Where Continent="Europe"
-> Order By RAND()
-> LIMIT 1;
If you do Limit 3 you should get 3 random rows.
-Original Message-
From: Ulf Harnhammar [mailto:[EMAIL PROTECTED]]
Sent: We
ution? I don't seem to find it in
Gordon Bruce
Oh, if you GRANT ALL ON *.* instead of .* with MySQL Front
you don't get the
SHOWDATABASES, CREATE TEMPORARYTABLES and LOCK TABLES
privileges.
This is what happens when you use LIMIT
MySQL retrieves the entire record set for the select and then sends the
number requested in the LIMIT parameter to the client. MySQL has to
retrieve the entire result set to accommodate a LIMIT clause which skips
n records i.e. LIMIT 250,10.
With no ORDER B
Use the concat function. It takes any number of arguments.
mysql> create table test (a char(5));
Query OK, 0 rows affected (0.04 sec)
mysql> insert into test values ('A');
Query OK, 1 row affected (0.02 sec)
mysql> select * from test;
+--+
| a|
+--+
| A|
+--+
1 row in set (0.
When I have seen this error it was caused by a field defined in the
MySQL database as NOT NULL in the Create table and the value in Access
is NULL or usually for us an empty field in EXCEL which is appears to be
intreped as NULL when you do a PASTE APPEND.
Ours is often times a datetime field but
If you really need more than 20 digits of accuracy and can move to 5.0.3
+
you can use the Decimal data type without losing precision.
This is out of Chapter 23. Precision Math
The maximum value of 64 for M means that calculations on DECIMAL values
are accurate up to 64 digits. This limit of 64
select count(distinct ordr_ID) from store
-Original Message-
From: Gana [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 07, 2005 3:01 PM
To: mysql@lists.mysql.com
Subject: Count(*)
select count(*) from store group by orederId.
For the above sql, I am not getting the count of unique orde
Here is one way.
Some time ago I set up a table named count with one field named count
and built 5000 rows of incrementing values .
I think I originally populated it by originally createing it with a 2nd
field
CREATE TABLE `count` (
`count` int(10) unsigned NOT NULL auto_increment,
`add
A database in MySQL is simply a directory.
So just rename the directory with appropriate tool for your platform.
On my test box this becomes
mysql> show databases;
++
| Database
|
++
| information_schema |
|
lois
Something like this
SELECT CompanyName,
WhatToShip,
SUM(IF(TrackingNumber = '',
IF(SerialNumber = '',
1,
0),
0)
) AS READY,
SUM(IF(TrackingNumber <> '',
IF(SerialNumber = '',
We have a relatively small web site running 4.0.20 on a Dell 2850
running RedHat.
We rarely see any SQL statements visible when we run SHOW PROCESSLIST
and typically use 30 - 40 concurrent connections.
The Number of SQL Queries graph in MySQL Administrator usually is in the
0 to 10 range wit
This is out of the MySQL class and is called the Max-Concat trick.
What is the biggest country in each continent?
"The Rows Holding the Group-wise Maximum of a Certain Field"
MySQL> Select Continent,
-> SUBSTRING(M
Multi Table UPDATES are first supported in 4.0.x
-Original Message-
From: Brendan Gogarty [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 09, 2005 12:16 PM
To: [EMAIL PROTECTED]
Cc: mysql@lists.mysql.com
Subject: RE: JOIN QUERY -> UPDATE ... help?!
"Brendan Gogarty" <[EMAIL PROTECTED]>
If you are on a version prior to 4.1.2 the max index size is 500 bytes
{not sure why the error mentions 1024}
>From section 14.1 of documention
The maximum key length is 1000 bytes (500 before MySQL 4.1.2). This can
be changed by recompiling. For the case of a key longer than 250 bytes,
a larger
You can use INTERVAL i.e.
Lets say you have a table
mysql> CREATE TABLE foo (bar int(14), fdate date );
Query OK, 0 rows affected (0.27 sec)
mysql> INSERT INTO foo
> VALUES (1, now()),
(25,now() - INTERVAL 1 DAY),
(15,now() - INTERVAL 2 DAY);
mysql> SELECT f1.
If you want to have all values except the primary key be the same and
say your is foo_ID
You can simply do
INSERT INTO foo
(foo_ID... {rest of columns list})
SELECT new primary key value,
{rest of columns list}
FROM foo
WHERE foo_ID = {primary key value of row you want to copy}
If
Do You know about INTERVAL?
Use it in an exprecssion or funtion as
..INTERVAL expr type
where expr is any numerical value
* The INTERVAL keyword and the type specifier are not case
sensitive.
The following table shows how the type a
I think you misunderstand how auto_increment works. Primary keys using
auto_increment are NOT row numbers.
If your table has a primary key that is an auto_increment field then
when you add a row to the table the value of the primary key of the new
row is 1 greater than the max(Value) before the ro
If you have the 5.0.x version of MySQL then INFROMATION SCHEMA can give
you what you want. i.e.
SELECT a.*, b.*
FROM INFORMATION_SCHEMA.COLUMNS AS a
INNER JOIN _SCHEMA.COLUMNS AS b
ON (a.column_name = b.column_name)
WHERE a.TABLE_NAME = 'foo_1'
AND b.TABLE_NAME = 'foo
It's getting late on Friday, but couldn't you build a table with all of
the parameter combinations and then just join against that table?
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, August 26, 2005 4:25 PM
To: mysql@lists.mysql.com
Subject: Union vs
What am I missing
INSERT INTO table1 (column names.)
SELECT VALUES..
FROM table2
WHERE primary id = insert value
You will have to put in your real table name and column names.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, September 23, 200
Try this
mysql> select distinct secname, date
-> from optresult
-> where secname like 'swap%'
->and date like '2005-09-2%'
-> order by if(secname like 'swap%',
-> (mid(secname,5,20)+0),
-> secname);
+--++
| secname | d
IF you are on 5.0.x you can use INFORMATION_SCHEMA
21.1.13. The INFORMATION_SCHEMA KEY_COLUMN_USAGE Table
http://dev.mysql.com/doc/mysql/en/key-column-usage-table.html
-Original Message-
From: Operator [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 05, 2005 3:02 PM
To: mysq
You might try UNION with the 1st statement pulling all products with
groupid = 0 and the 2nd pulling 1 product with groupid > 1.
-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED]
Sent: Monday, October 10, 2005 3:31 PM
To: MySQL List
Subject: [SPAM] - Query help - Bayesian Fil
After reading one of the recent posts from Gobi [EMAIL PROTECTED]
I took his successful query and modified it for one of my tables. It indeed
produce the correct result, but in the process raised some questions.
1. Why do list_ID and acct_ID not have to be qualified with a table
name or
If your MySQL server is a *nix system than table names are case
sensitive.
SELECT A.*,
CASE CounselorOnly
WHEN 1 THEN 'Yes'
WHEN 0 THEN 'No'
END AS CO
FROM Activities A
ORDER BY Activity
I also just noticed, remove the "CO =" and add "AS CO" following the END
Is it possible to change the geocodes table to look like
CREATE TABLE `geocodes` (
`ip` int(10) unsigned zerofill NOT NULL default '00',
`lat` double default NULL,
`lon` double default NULL,
PRIMARY KEY (`ip`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Then you could do
SELE
Try this
{I wasn't sure whether cd_nature_ltr is in ligne_trans
or transaction. This assumes ligne_trans. If it is in
transaction thatn move "cd_nature_ltrsn = 2" into the ON clause.}
SELECT CASE id_ltrsn
WHEN NULL THEN 0
ELSE id_ltsrn
END AS id_ltrsn,
CASE
What is the source of the data that is displayed on the screen. If it is
a field in a MySQL table and the data type for that field is either DATE
or DATETIME then it will intsert/update without any manipulation.
Try doing a
SELECT datefield
FROM table
Limit 15;
outside of your ASP.NET envi
This is kind of ugly, but with the multitable limitations of 3.23 it
probably works.
CREATE TABLE TEMP
SELECT table_1 columns except age, table_2 age
FROM table_1
INNER JOIN table_2
USING (name);
TRUNCATE table_1;
INSERT INTO table_1
SELECT *
FROM TEMP;
DROP TABLE_1;
--
Sorry the DROP TABLE Should be TEMP not table1
-Original Message-
From: Gordon Bruce [mailto:[EMAIL PROTECTED]
Sent: Friday, December 09, 2005 3:51 PM
To: Sachin Bhugra; mysql@lists.mysql.com
Cc: [EMAIL PROTECTED]
Subject: RE: copying data!!!
This is kind of ugly, but with the
The following takes a little effort, but it should get you close to dump
file size.
On 5.0.x you can use Information_schema.columns to get average row
length for MyISAM tables. Take that plus the punctutation {~35 + 3* #
cols for insert per row if you enclose your columns in "'s} in the
insert sta
er_Create |
+-+-+-+-+--+--+---+----+++-+--+-
Generally MySQL does format conversion for you to match data types.
You can also force the CONCAT result to be integer by the following
where concat(year,period,week) + 0 < 2007031
^^^
-Original Message-
From: Jay Paulson (CE CEN) [mailto:[EMAIL PROTECTED]
1 - 100 of 187 matches
Mail list logo