Re: how to select the record with one sql statement?

2018-08-18 Thread shawn l.green
y for num_of_day); expecting the output: certain_day, pigId;from certain_day, pigId'weight increasing continuously for num_of_day. How to select the records in one sql statement? thanks I've thought about this a bit (since your question appeared on the list) and I break dow

how to select the record with one sql statement?

2018-08-13 Thread sea
from certain_day, pigId'weight increasing continuously for num_of_day. How to select the records in one sql statement? thanks

SQL statement to populate Start and End dates Everyday with an Interval of certain day(s)

2009-08-28 Thread sAvEOUrplAnEt
I had the following fields for my calendar: start_date = "08/01/09" (starts on) end_date = "08/31/09" (ends on) the_length = "1" (everyday) repeat_every = "2" (with an interval of 2 days) Now, I want to use SQL statement to populate

Re: the max length of one SQL statement

2009-03-19 Thread Cui Shijun
hi, According to the transfer limit, ... 16M? 2009/3/20 raid fifa : > Hi guys, > > Anybody knows that how many bytes the max length of on SQL statement can be > in MySQL database? > I know it's 64KB i

the max length of one SQL statement

2009-03-19 Thread raid fifa
Hi guys,   Anybody knows that how many bytes the max length of on SQL statement can be in MySQL database? I know it's 64KB in Oracle.   Thanks. *^_^* ___ 好玩贺卡等你发,邮箱贺卡全新上线! http://card.mail.cn.yahoo.com/

Re: Speed up slow SQL statement.

2008-10-24 Thread Moon's Father
gt; > browse_nodes_to_products.browse_node_id is defined as an INDEX so it's > > indexed. > > browse_nodes.amazon_id is defined as an INDEX so it's indexed. > > > > See http://pastebin.com/m46cced58 > > It has complete table structures, row counts and EX

Re: Speed up slow SQL statement.

2008-09-29 Thread Rob Wultsch
e table structures, row counts and EXPLAIN output of the SQL > statement I'm trying to optimize. > > I don't think I understand your question regarding carrying the product_id > through the relationship. This is a many to many relationship. A browse_node > can contain many

Re: Speed up slow SQL statement.

2008-09-29 Thread Eric Stewart
n INDEX so it's indexed. See http://pastebin.com/m46cced58 It has complete table structures, row counts and EXPLAIN output of the SQL statement I'm trying to optimize. I don't think I understand your question regarding carrying the product_id through the relationship. This is a

RE: Speed up slow SQL statement.

2008-09-26 Thread Martin Gainty
content contained within this transmission. > From: [EMAIL PROTECTED] > To: mysql@lists.mysql.com > Subject: Speed up slow SQL statement. > Date: Fri, 26 Sep 2008 10:42:07 -0400 > > Good morning everyone, > > I've got a sql statement that is running quite slow. I&#x

Speed up slow SQL statement.

2008-09-26 Thread Eric Stewart
Good morning everyone, I've got a sql statement that is running quite slow. I've indexed everything I can that could possibly be applicable but I can't seem to speed it up. I've put up the table structures, row counts, the sql statement and the explain dump of the

Re: help with a sql statement

2008-03-31 Thread paul rivers
tech user wrote: Add an alias for the subquery select * from ( select ) my_alias where dd >= 3; Better, use a having clause and eliminate the subquery. Odds are it will be more efficient in MySQL. How to replace the original one with a having statement? Thanks again. sele

Re: help with a sql statement

2008-03-31 Thread tech user
> > Add an alias for the subquery > > select * from ( select ) my_alias where dd >= 3; > > Better, use a having clause and eliminate the subquery. Odds are it > will be more efficient in MySQL. > How to replace the original one with a having statement? Thanks again. Get the n

Re: help with a sql statement

2008-03-31 Thread paul rivers
own alias But I can execute the sql statement of "select uin,count(*) as dd from active_users where date >= date_add(curdate(),interval -30 day) group by uin" successfully. How to fixup it? thanks! Get the name you always wanted with the new y7mail email address. ww

help with a sql statement

2008-03-31 Thread tech user
n execute the sql statement of "select uin,count(*) as dd from active_users where date >= date_add(curdate(),interval -30 day) group by uin" successfully. How to fixup it? thanks! Get the name you always wanted with the new y7mail email address. www.yahoo7.com.au/y7mail

Re: Why can't I still not use an ALIAS in the SELECT portion of an SQL statement?

2007-10-23 Thread mysql
[EMAIL PROTECTED] wrote: Daevid Vincent wrote: Nope. I've only ever use mySQL. I only ever care to use mySQL. mySQL puts in plenty of other features that no other RDBMS has or uses, and other RDBMS have features that mySQL has, so what's the problem. Unless I was porting to/from another RDBMS?

Re: Why can't I still not use an ALIAS in the SELECT portion of an SQL statement?

2007-10-23 Thread mysql
Daevid Vincent wrote: Nope. I've only ever use mySQL. I only ever care to use mySQL. mySQL puts in plenty of other features that no other RDBMS has or uses, and other RDBMS have features that mySQL has, so what's the problem. Unless I was porting to/from another RDBMS? This strikes me as a *ter

RE: Why can't I still not use an ALIAS in the SELECT portion of an SQL statement?

2007-10-23 Thread Daevid Vincent
- > From: Peter Brawley [mailto:[EMAIL PROTECTED] > Sent: Tuesday, October 23, 2007 5:39 PM > To: Daevid Vincent > Cc: mysql@lists.mysql.com > Subject: Re: Why can't I still not use an ALIAS in the SELECT > portion of an SQL statement? > > >When will I be able to do so

Re: Why can't I still not use an ALIAS in the SELECT portion of an SQL statement?

2007-10-23 Thread Peter Brawley
When will I be able to do something seemingly so basic as this re-use of an alias? Do you know an implementation of SQL which allows this? PB Daevid Vincent wrote: When will I be able to do something seemingly so basic as this re-use of an alias? SELECT DATE_ADD('2007-10-23', INTERVAL user_a

Why can't I still not use an ALIAS in the SELECT portion of an SQL statement?

2007-10-23 Thread Daevid Vincent
When will I be able to do something seemingly so basic as this re-use of an alias? SELECT DATE_ADD('2007-10-23', INTERVAL user_access_hours HOUR) AS group_duration_date, UNIX_TIMESTAMP(group_duration_date) AS group_duration_date_timestamp FROM end_user

Re: SQL statement work in mysql4 but not mysql5

2006-10-10 Thread Peter Brawley
ums f, ibf_categories c LEFT JOIN ibf_moderators m ON (f.id=m.forum_id) WHERE c.id=f.category ORDER BY c.position, f.position Error: Unknown column 'f.id' in 'on clause' The alias seem not working? What should I do, I dont want to rewrite all my

Re: SQL statement work in mysql4 but not mysql5

2006-10-10 Thread Jo�o C�ndido de Souza Neto
gt; LEFT JOIN ibf_moderators m ON (f.id=m.forum_id) > WHERE c.id=f.category > ORDER BY c.position, f.position > > Error: > Unknown column 'f.id' in 'on clause' > > The alias seem not working? > What should I do, I dont want to rewrite

SQL statement work in mysql4 but not mysql5

2006-10-10 Thread Jason Chan
ition, f.position Error: Unknown column 'f.id' in 'on clause' The alias seem not working? What should I do, I dont want to rewrite all my sql statement Thanks. Jason -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http

Re: The number of left join in one SQL statement.

2006-06-16 Thread Pooly
Hi, 2006/6/16, Takanobu Kawabe <[EMAIL PROTECTED]>: [snip] I tried this statement without error. But Ihave some questions. 1.How many left join keywords can I use in one SQL statement if there are 5000 datas in one table? as this blog point out, its 31 or 61 dep

Re: The number of left join in one SQL statement.

2006-06-16 Thread Barry
Takanobu Kawabe schrieb: > Hello, my name is Takanobu Kawabe. こんいちわ孝信さん:) > I have some questions about left join SQL statement. > > I want to join some tables, and using left join statement . > > the system is the following. I use two machines. > &g

The number of left join in one SQL statement.

2006-06-16 Thread Takanobu Kawabe
Hello, my name is Takanobu Kawabe. I have some questions about left join SQL statement. I want to join some tables, and using left join statement . the system is the following. I use two machines. I created the same databases and tables on both machines. OS : Debian

Re: max_allowed_packet via SQL Statement

2006-05-17 Thread Dan Nelson
In the last episode (May 18), Jim said: > Is there any way of getting the max_allowed_packet setting via a SQL > statement? mysql> SHOW VARIABLES LIKE 'max_allowed_packet'; ++--+ | Variable_name | Value| ++--+ |

max_allowed_packet via SQL Statement

2006-05-17 Thread Jim
Hi All, Is there any way of getting the max_allowed_packet setting via a SQL statement? Eg. select version(); returns the version and need to do same for max_packet_size.

Re: Optimizing SQL statement

2006-04-20 Thread Puiu Hrenciuc
First of all thanks all for your answers. Second I'll explain what I manage to do in regard with this issue, maybe someone else may need it in the future. So, first I have started by changing the way I have stored the `ip` field from varchar(15) to int unsigned and populated this field with the 4

Re: Optimizing SQL statement

2006-04-20 Thread Joerg Bruehe
Hi all! (Sorry for the late reply.) Puiu Hrenciuc wrote (re-ordered): "Barry" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Puiu Hrenciuc wrote: Hi, I have a table ( MyISAM, MySQL 5.0.20, FreeBSD ) containing network traffic data : record_time datetime - time when recording

Re: Optimizing SQL statement

2006-04-14 Thread Philippe Poelvoorde
2006/4/13, Puiu Hrenciuc <[EMAIL PROTECTED]>: > Hi, > > I have a table ( MyISAM, MySQL 5.0.20, FreeBSD ) containing network traffic > data : > > record_time datetime - time when recording was added > ip char(15) - ip that generated the traffic > type tinyint(3) - traffic type ( 1 - local, 2 - inte

Re: Optimizing SQL statement

2006-04-13 Thread Puiu Hrenciuc
Hmmm, I have omited that : I also have an index on (ip,type) in that order "Barry" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Puiu Hrenciuc wrote: >> Hi, >> >> I have a table ( MyISAM, MySQL 5.0.20, FreeBSD ) containing network >> traffic data : >> >> record_time datetime -

Re: Optimizing SQL statement

2006-04-13 Thread Barry
Puiu Hrenciuc wrote: Hi, I have a table ( MyISAM, MySQL 5.0.20, FreeBSD ) containing network traffic data : record_time datetime - time when recording was added ip char(15) - ip that generated the traffic type tinyint(3) - traffic type ( 1 - local, 2 - internet ) inbound int(10) - in bytes o

Optimizing SQL statement

2006-04-13 Thread Puiu Hrenciuc
Hi, I have a table ( MyISAM, MySQL 5.0.20, FreeBSD ) containing network traffic data : record_time datetime - time when recording was added ip char(15) - ip that generated the traffic type tinyint(3) - traffic type ( 1 - local, 2 - internet ) inbound int(10) - in bytes outbound int(10) - out by

RE: Update or insert with a single SQL statement?

2006-03-31 Thread Shaunak Kashyap
nal Message- > From: Greg Donald [mailto:[EMAIL PROTECTED] > Sent: Friday, March 31, 2006 2:38 PM > To: mysql@lists.mysql.com > Subject: Re: Update or insert with a single SQL statement? > > On 3/31/06, Brian Dunning <[EMAIL PROTECTED]> wrote: > > I have a

Re: Update or insert with a single SQL statement?

2006-03-31 Thread Greg Donald
On 3/31/06, Brian Dunning <[EMAIL PROTECTED]> wrote: > I have a really simple two-column database: > > domain_name (primary key) > timestamp > > I'm trying to keep track of the referrer of every visit to a web > site, and I'm looking for a single SQL state

Update or insert with a single SQL statement?

2006-03-31 Thread Brian Dunning
I have a really simple two-column database: domain_name (primary key) timestamp I'm trying to keep track of the referrer of every visit to a web site, and I'm looking for a single SQL statement (since my ISP limits the total number of calls I can make in a day) that will either

Re: Help on sql statement (not MySQL specifik)

2006-03-05 Thread Rhino
---- From: "Søren Merser" <[EMAIL PROTECTED]> To: Sent: Sunday, March 05, 2006 4:37 PM Subject: Re: Help on sql statement (not MySQL specifik) Hi Thank You for all Your efforts I'll try once again to clarify my problem My tabel (t_temp) isn't corrupt but is the resu

Re: Help on sql statement (not MySQL specifik)

2006-03-05 Thread Søren Merser
[EMAIL PROTECTED]> To: "Michael Stassen" <[EMAIL PROTECTED]> Cc: "Søren Merser" <[EMAIL PROTECTED]>; Sent: Sunday, March 05, 2006 9:05 PM Subject: Re: Help on sql statement (not MySQL specifik) You're absolutely right that I'd need some good luck for thi

Re: Help on sql statement (not MySQL specifik)

2006-03-05 Thread Rhino
probably be a lot easier if the data was clean to start with. In any case, thanks for keeping me honest. -- Rhino - Original Message - From: "Michael Stassen" <[EMAIL PROTECTED]> To: "Rhino" <[EMAIL PROTECTED]> Cc: "Søren Merser" <[EMAIL

Re: Help on sql statement (not MySQL specifik)

2006-03-05 Thread Michael Stassen
Rhino wrote: I don't really understand _why_ you want to do this but here is a query that gives the result you want: select id, case type when 4 then 4 else null end as type from Soren01 group by id; The GROUP BY ensures that you get one row for each value of id; the case expression in the Se

Re: Help on sql statement (not MySQL specifik)

2006-03-05 Thread Rhino
le will try to help you. -- Rhino - Original Message - From: "Michael Stassen" <[EMAIL PROTECTED]> To: "Søren Merser" <[EMAIL PROTECTED]> Cc: Sent: Sunday, March 05, 2006 1:13 PM Subject: Re: Help on sql statement (not MySQL specifik) Søren Merser wrote:

Re: Help on sql statement (not MySQL specifik)

2006-03-05 Thread Rhino
says that if the value of the type is 4, leave it alone, otherwise display null. -- Rhino - Original Message - From: "Søren Merser" <[EMAIL PROTECTED]> To: ; "Rhino" <[EMAIL PROTECTED]> Sent: Sunday, March 05, 2006 11:46 AM Subject: Re: Help on sql state

Re: Help on sql statement (not MySQL specifik)

2006-03-05 Thread Michael Stassen
Søren Merser wrote: Hi, I'll try I need one record for each id in the tabel, i.e. NO duplicate id's with TYPE set to 4 or NULL Now, the TYPE of id 2 is 4 so I peserve it; As id 2 has more than one entry I have to delete it/them Id's with TYPE = NULL (id 1,4,5)is kept Id 5 (and 6) has two rec

Re: Help on sql statement (not MySQL specifik)

2006-03-05 Thread Søren Merser
<-NULL 7| 5|3<-DROP 8| 6|7<-NULL 9| 6|3 <-DROP What I neede is a SQL statement that for a given value of TYPE, lets say 4, selects all the unique id

Re: Help on sql statement (not MySQL specifik)

2006-03-05 Thread Ronald J. Yacketta
I think he wants to update rows where != 4 to null that is, update TYPE setting TYPE to null where TYPE != 4 -Ron Rhino wrote: - Original Message - From: "Søren Merser" <[EMAIL PROTECTED]> To: Sent: Sunday, March 05, 2006 9:12 AM Subject: Help on sql statement (no

Re: Help on sql statement (not MySQL specifik)

2006-03-05 Thread Rhino
- Original Message - From: "Søren Merser" <[EMAIL PROTECTED]> To: Sent: Sunday, March 05, 2006 9:12 AM Subject: Help on sql statement (not MySQL specifik) Hi Could someone please help me out here? TABLE: RECNO| ID |TYPE ---

Help on sql statement (not MySQL specifik)

2006-03-05 Thread Søren Merser
9| 6|3<-DROP What I neede is a SQL statement that for a given value of TYPE, lets say 4, selects all the unique id's with TYPE = 4 when appropriate otherwise NULL like: SOLUTION: RECNO| ID |TYPE - 1

RE: SQL Statement Help

2005-12-14 Thread Charles Walmsley
best wishes Ch -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: 14 December 2005 19:22 To: Jesse Cc: mysql@lists.mysql.com Subject: Re: SQL Statement Help "Jesse" <[EMAIL PROTECTED]> wrote on 12/14/2005 02:03:22 P

Re: SQL Statement Help

2005-12-14 Thread SGreen
"Jesse" <[EMAIL PROTECTED]> wrote on 12/14/2005 02:03:22 PM: > Hello, > I need help building a SQL Statement. I'm currently using MySQL > 5.something. This one is kind of strange, and I can't seem to figure out > how to do it. > > I have a t

Re: SQL Statement Help

2005-12-14 Thread Martijn Tonies
> Hello, > I need help building a SQL Statement. I'm currently using MySQL > 5.something. This one is kind of strange, and I can't seem to figure out > how to do it. > > I have a table named Participants. Each Participant is allowed to bring up > to 5 Guests. In

SQL Statement Help

2005-12-14 Thread Jesse
Hello, I need help building a SQL Statement. I'm currently using MySQL 5.something. This one is kind of strange, and I can't seem to figure out how to do it. I have a table named Participants. Each Participant is allowed to bring up to 5 Guests. Instead of putting the names in

Re: where is the mistake in this SQL statement?

2005-11-15 Thread Joerg Bruehe
Hi Peter, all! Peter Matulis wrote: --- Joerg Bruehe <[EMAIL PROTECTED]> wrote: [[...]] CREATE TABLE users ( id PRIMARY KEY, priority integer NOT NULL DEFAULT '7', policy_id integer unsigned NOT NULL DEFAULT '1', Even though this may work, it is wrong IMNSHO: You set character strings

Re: where is the mistake in this SQL statement?

2005-11-15 Thread Peter Matulis
--- Joerg Bruehe <[EMAIL PROTECTED]> wrote: > Sujay Koduri wrote: > > You havent specified the datatype for the column 'id'. > > Right, this should be fatal. > But I also take issue with other parts: > > > > > CREATE TABLE users ( > > id PRIMARY KEY, > > priority integer NOT NULL DEFAULT

Re: where is the mistake in this SQL statement?

2005-11-15 Thread Jasper Bryant-Greene
Harald Fuchs wrote: In article <[EMAIL PROTECTED]>, Joerg Bruehe <[EMAIL PROTECTED]> writes: CREATE TABLE users ( id PRIMARY KEY, priority integer NOT NULL DEFAULT '7', policy_id integer unsigned NOT NULL DEFAULT '1', Even though this may work, it is wrong IMNSHO: You set character strings

Re: where is the mistake in this SQL statement?

2005-11-15 Thread Harald Fuchs
In article <[EMAIL PROTECTED]>, Joerg Bruehe <[EMAIL PROTECTED]> writes: >> CREATE TABLE users ( >> id PRIMARY KEY, >> priority integer NOT NULL DEFAULT '7', >> policy_id integer unsigned NOT NULL DEFAULT '1', > Even though this may work, it is wrong IMNSHO: > You set character strings as defaul

Re: where is the mistake in this SQL statement?

2005-11-15 Thread Joerg Bruehe
Hi all, Peter! Sujay Koduri wrote: You havent specified the datatype for the column 'id'. Right, this should be fatal. But I also take issue with other parts: [[...]] -Original Message- From: Peter Matulis [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 15, 2005 10:57 AM [[...

RE: where is the mistake in this SQL statement?

2005-11-14 Thread Sujay Koduri
You havent specified the datatype for the column 'id'. sujay -Original Message- From: Peter Matulis [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 15, 2005 10:57 AM To: mysql@lists.mysql.com Subject: where is the mistake in this SQL statement? { this is a resend, forgot

where is the mistake in this SQL statement?

2005-11-14 Thread Peter Matulis
{ this is a resend, forgot subject in original posting } Hello, I am using MySQL 4.0.24 on OpenBSD 3.8. I am having difficulty creating a SQL schema. My attempts contain lines like: CREATE TABLE users ( id PRIMARY KEY, priority integer NOT NULL DEFAULT '7', policy_id integer unsigned NOT

RE: SQL Statement Conversion

2005-11-04 Thread Gordon Bruce
and add "AS CO" following the END of the case statement. -Original Message- From: Jesse Castleberry [mailto:[EMAIL PROTECTED] Sent: Friday, November 04, 2005 3:54 PM To: MySQL List Subject: SQL Statement Conversion I'm converting an application from SQL Server to MySQL. I ha

SQL Statement Conversion

2005-11-04 Thread Jesse Castleberry
I'm converting an application from SQL Server to MySQL. I have the following query that I need to convert: SELECT A.*, CO = CASE CounselorOnly WHEN 1 THEN 'Yes' WHEN 0 THEN 'No' END FROM Activities a ORDER BY Activity What is the proper syntax for this in MySQL? Thanks, Jesse -- MySQL Genera

Thank you ... Help on writing a sql statement

2005-10-28 Thread Imran
Hi Shawn: Just wanted to publicly thank you for the time you took to help me. I think that it is important that guys like yourself who take time out from your busy work be appreciated when their solution made a huge difference. I was developing an ASP application along with Crystal reports for

Re: Help needed for SQL statement

2005-10-24 Thread Alvaro Cobo
Chen" <[EMAIL PROTECTED]> To: Sent: Monday, October 24, 2005 11:43 PM Subject: Help needed for SQL statement > Hi, > > I have such a situation: > > There is a table with gene_ids and clone_ids. Each gene only resides on a > single clone and each clone may contain multipl

Help needed for SQL statement

2005-10-24 Thread Xiaobo Chen
Hi, I have such a situation: There is a table with gene_ids and clone_ids. Each gene only resides on a single clone and each clone may contain multiple genes. How do would I find how many genes are on each and every clone? Thanks in advance. X.Chen -- MySQL General Mailing List For list arch

Re: SQL statement help

2005-10-17 Thread SGreen
D = 0 > > > >J.R. > > > >-Original Message- > >From: C.F. Scheidecker Antunes [mailto:[EMAIL PROTECTED] > >Sent: Sunday, October 16, 2005 1:45 PM > >To: mysql@lists.mysql.com > >Subject: SQL statement help > >Importance: High > > >

Re: SQL statement help

2005-10-17 Thread Terence
it for you. UPDATE table_one t1, table_two t2 SET t1.ID = t2.ID WHERE t2.num = t1.num AND t1.ID = 0 J.R. -Original Message- From: C.F. Scheidecker Antunes [mailto:[EMAIL PROTECTED] Sent: Sunday, October 16, 2005 1:45 PM To: mysql@lists.mysql.com Subject: SQL statement help Importance

Re: SQL statement help

2005-10-16 Thread C.F. Scheidecker Antunes
PROTECTED] Sent: Sunday, October 16, 2005 1:45 PM To: mysql@lists.mysql.com Subject: SQL statement help Importance: High Hello All, I have two MySQL 4.1 tables. The first table has an ID field which is set to zero. The second one has ID fields and filenames. I need a single SQL statement to set the

Re: SQL statement help

2005-10-16 Thread C.F. Scheidecker Antunes
statement help Importance: High Hello All, I have two MySQL 4.1 tables. The first table has an ID field which is set to zero. The second one has ID fields and filenames. I need a single SQL statement to set the ID from table 1 to the ID from table 2 ONLY IF the ID on one is zero. That is, if the ID on

RE: SQL statement help

2005-10-16 Thread J.R. Bullington
: mysql@lists.mysql.com Subject: SQL statement help Importance: High Hello All, I have two MySQL 4.1 tables. The first table has an ID field which is set to zero. The second one has ID fields and filenames. I need a single SQL statement to set the ID from table 1 to the ID from table 2 ONLY IF the

SQL statement help

2005-10-16 Thread C.F. Scheidecker Antunes
Hello All, I have two MySQL 4.1 tables. The first table has an ID field which is set to zero. The second one has ID fields and filenames. I need a single SQL statement to set the ID from table 1 to the ID from table 2 ONLY IF the ID on one is zero. That is, if the ID on table one is not set

Re: Help on writing a sql statement

2005-10-11 Thread SGreen
; > best regards > Imran > > > > - Original Message - > From: <[EMAIL PROTECTED]> > To: "Imran" <[EMAIL PROTECTED]> > Cc: > Sent: Tuesday, October 11, 2005 11:33 AM > Subject: Re: Help on writing a sql statement > > &g

Re: Help on writing a sql statement

2005-10-11 Thread Imran
ay, October 11, 2005 11:33 AM Subject: Re: Help on writing a sql statement > Will you have name collisions with the same temporary table names used > from different connections? Nope. > > Temporary tables and user-defined (@-variables) are connection-specific. > Even if the same use

Re: Help on writing a sql statement

2005-10-11 Thread SGreen
> table will exist already exist > > > best regards > Imran. > > - Original Message - > From: <[EMAIL PROTECTED]> > To: "Imran" <[EMAIL PROTECTED]> > Cc: > Sent: Tuesday, October 11, 2005 9:49 AM > Subject: Re: Help on writing

Re: Help on writing a sql statement

2005-10-11 Thread Imran
ay, October 11, 2005 9:49 AM Subject: Re: Help on writing a sql statement > (my response bottom-posted. See below - SG) > > - Original Message - > > From: <[EMAIL PROTECTED]> > > To: "Imran" <[EMAIL PROTECTED]> > > Cc: > > Sent: Mond

Re: Help on writing a sql statement

2005-10-11 Thread SGreen
eport` int(10) default NULL, > PRIMARY KEY (`ID`), > KEY `ProdNo` (`ProdNo`), > KEY `Branch` (`Branch`) > ) > > - Original Message - > From: <[EMAIL PROTECTED]> > To: "Imran" <[EMAIL PROTECTED]> > Cc: > Sent: Monday, October 10, 2005 4

Re: Help on writing a sql statement

2005-10-10 Thread Imran
l Message - From: <[EMAIL PROTECTED]> To: "Imran" <[EMAIL PROTECTED]> Cc: Sent: Monday, October 10, 2005 4:17 PM Subject: Re: Help on writing a sql statement > "Imran" <[EMAIL PROTECTED]> wrote on 10/10/2005 03:52:21 PM: > > > Hi all: > > I

Re: Help on writing a sql statement

2005-10-10 Thread SGreen
"Imran" <[EMAIL PROTECTED]> wrote on 10/10/2005 03:52:21 PM: > Hi all: > I need some help in writing a sql statement. > > I have three tables (Sales, Cust and Product). The sales table contains a > large volume of data and I want to create a sql to group

Help on writing a sql statement

2005-10-10 Thread Imran
Hi all: I need some help in writing a sql statement. I have three tables (Sales, Cust and Product). The sales table contains a large volume of data and I want to create a sql to group the sales table then join the resultant to both the Cust and Prod and to have additional fields selected

Re: A SQL statement to copy a blob from one table to another

2005-10-06 Thread Jasper Bryant-Greene
C.F. Scheidecker Antunes wrote: I want to insert the blob file from table1 where id = 1 to table2. To select the blob I would issue: select file from table1 where id = 1 To insert I would do: insert into table2 (blob) values(?) INSERT INTO table2 (blob) SELECT file FROM table1 WHERE id=1 -- J

A SQL statement to copy a blob from one table to another

2005-10-06 Thread C.F. Scheidecker Antunes
Hello everyone: I have two tables that store a blob. They both have Id fields. What I would like to do is, given an id, copy the blob stored on table one to table two. I could do that in my java program by selecting and retrieving the blob from table 1 and then issuing a insert/replace statemen

Re: SQL statement generated from prepared statement

2005-08-19 Thread Darrell Cormier
On Thursday 18 August 2005 16:37, Gleb Paharenko wrote: > Hello. > > These links might be helpful: > http://dev.mysql.com/doc/mysql/en/query-log.html > http://dev.mysql.com/doc/mysql/en/debugging-client.html > http://dev.mysql.com/doc/mysql/en/debugging-server.html > > Use a fresh ver

Re: SQL statement generated from prepared statement

2005-08-19 Thread Gleb Paharenko
from prepared statements properly. Darrell Cormier <[EMAIL PROTECTED]> wrote: > Is there a way to get MySQL to report the SQL statement it receives from > a prepared statement execution (from a program using the C-API )? I am > wondering what the SQL statement looks like tha

SQL statement generated from prepared statement

2005-08-18 Thread Darrell Cormier
Is there a way to get MySQL to report the SQL statement it receives from a prepared statement execution (from a program using the C-API )? I am wondering what the SQL statement looks like that is being generated from my program to help debug it. Thanks, DC -- Darrell Cormier <[EM

Re: optimize a sql statement

2005-07-28 Thread Gleb Paharenko
ef', > 'PRIMARY,order_line_ol_i_id,order_line_ol_o_id,order_line_test', > 'order_line_ol_o_id', '4', 'tpcw.orders.o_id', 1, 'Using where' > 3, 'SUBQUERY', '', '', '', ''

Re: optimize a sql statement

2005-07-22 Thread 王 旭
x27;, 1, 'Using where; Using index' 2, 'DEPENDENT SUBQUERY', 'order_line', 'ref', 'PRIMARY,order_line_ol_i_id,order_line_ol_o_id,order_line_test', 'order_line_ol_o_id', '4', 'tpcw.orders.o_id', 1, 'Using where' 3, '

Re: optimize a sql statement

2005-07-21 Thread Sebastian
sing index' > 2, 'DEPENDENT SUBQUERY', 'order_line', 'ref', > 'PRIMARY,order_line_ol_i_id,order_line_ol_o_id,order_line_test', > 'order_line_ol_o_id', '4', 'tpcw.orders.o_id', 1, 'Using where' > 3, 'SUBQUERY', '

Re: optimize a sql statement

2005-07-21 Thread 王 旭
ine_test', 'order_line_ol_o_id', '4', 'tpcw.orders.o_id', 1, 'Using where' 3, 'SUBQUERY', '', '', '', '', '', '', , 'Select tables optimized away&#

Re: optimize a sql statement

2005-07-21 Thread 王 旭
Thank you SGreen.But i can'optimize the sql statement like your way because this query must describe in one sql statement.So i think i maybe optimize this sql statement through creating high efficiency index or describe this sql statement in other method. Rewrite this sql statement must i

Re: optimize a sql statement

2005-07-19 Thread SGreen
王 旭 <[EMAIL PROTECTED]> wrote on 07/18/2005 03:12:28 AM: > NO effect :-( > > >From: pow <[EMAIL PROTECTED]> > >To: 王 旭 <[EMAIL PROTECTED]> > >Subject: Re: optimize a sql statement > >Date: Mon, 18 Jul 2005 11:51:23 +0800 > >

Re: optimize a sql statement

2005-07-18 Thread 王 旭
NO effect :-( From: pow <[EMAIL PROTECTED]> To: 王 旭 <[EMAIL PROTECTED]> Subject: Re: optimize a sql statement Date: Mon, 18 Jul 2005 11:51:23 +0800 Do u have composite index on order_line.ol_o_id AND order_line.ol_i_id? You could try that... 王 旭 wrote: > Now,I make this sql st

RE: optimize a sql statement

2005-07-17 Thread 王 旭
Now,I make this sql statement to easy. Follow is the sql statement: - SELECT ol_i_id FROM orders,order_line WHERE order_line.ol_o_id = orders.o_id GROUP BY ol_i_id

optimize a sql statement

2005-07-16 Thread 王 旭
Follow is my sql statement: - SELECT SUM(ol_qty) sumolqty, ol_i_id FROM orders, order_line WHERE orders.o_id = order_line.ol_o_id AND orders.o_id > (SELECT MAX(o_id)-1 FROM orders) AND

optimize a sql statement

2005-07-16 Thread 王 旭
Follow is my sql statement: - SELECT SUM(ol_qty) sumolqty, ol_i_id FROM orders, order_line WHERE orders.o_id = order_line.ol_o_id AND orders.o_id > (SELECT MAX(o_id)-1 FROM orders) AND

Re: How to write SQL statement to do such query?

2005-06-03 Thread Michael Stassen
SQL My wrote: (B (B> Hi! dear all, (B> I encountered a problem with designing SQL statement. For example, I (B> want to query population information from a "city" table, and the (B> records returned must be ordered according to the population of the (B

How to write SQL statement to do such query?

2005-06-03 Thread SQL My
Hi! dear all, (BI encountered a problem with designing SQL statement. For example, I (Bwant to query population information from a "city" table, and the (Brecords returned must be ordered according to the population of the (Bcity. Like

Re: Problem in a very simple SQL statement

2005-03-11 Thread Mário Gamito
Arghh... shame on me forever. I'm speachless. Mikhail Entaltsev wrote: Missed FROM clause... ;) Best regards, Mikhail. - Original Message - From: "Mário Gamito" <[EMAIL PROTECTED]> To: Sent: Friday, March 11, 2005 1:49 PM Subject: Problem in a very simple SQL stateme

RE: Problem in a very simple SQL statement

2005-03-11 Thread Jay Blanchard
[snip] select count(email) where email='[EMAIL PROTECTED]'; [/snip] select count(email) FROM TABLE where email='[EMAIL PROTECTED]'; -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Problem in a very simple SQL statement

2005-03-11 Thread Mikhail Entaltsev
Missed FROM clause... ;) Best regards, Mikhail. - Original Message - From: "Mário Gamito" <[EMAIL PROTECTED]> To: Sent: Friday, March 11, 2005 1:49 PM Subject: Problem in a very simple SQL statement > Hi, > > Why do i get an error on this statement: >

Problem in a very simple SQL statement

2005-03-11 Thread Mário Gamito
Hi, Why do i get an error on this statement: select count(email) where email='[EMAIL PROTECTED]'; The error is: "ERROR 1064: You have an error in your SQL syntax near 'where email='[EMAIL PROTECTED]'' at line 1" The statement seems pretty clear to me, but obviously something's wrong. What can it

Re: Mysql 4.1 and the LIMIT sql statement

2005-03-09 Thread Dennis Fogg
; # LIMIT no longer accepts negative arguments. Use some large number >(maximum 18446744073709551615) instead of -1. > > not sure why it was changed, though. > This is going to break a fair number of phpMyEdit scripts because phpMyEdit's default template recommends $opts[&

value of array to sql statement

2004-12-28 Thread sam wun
Hi list, There is problem when with executing the sql statement in mysql 5.0. I m not sure whether version 4.x has the same problem. The problem is if I use static (hardcoded) values in the SQL statement, mysql returns result for each element in the array. If I use dynamically allocated value

  1   2   3   >