Am 05.06.2011 23:55, schrieb ag...@airpost.net:
i still have no idea why this is necessary.
take it or not
it is a professional solution which works for
databses with 20 GB every day here with rsync
without interrupt/lock mysqld a second
and it is much faster
there seems to be a but,
2011/03/23 16:29 -0700, Steffan A. Cline
So, this is what I have as a basis to work on assuming I am polling
article #36.
Select *, if(b.articleid=36,1,0) as checked from groups g
Left join agmap a on g.groupid=a.groupid
Left join articles b on a.articleid=b.articleid
Order by g.groupname
Why
Am 31.03.2011 17:53, schrieb S?ndor Hal?sz:
2011/03/23 16:29 -0700, Steffan A. Cline
So, this is what I have as a basis to work on assuming I am polling
article #36.
Select *, if(b.articleid=36,1,0) as checked from groups g
Left join agmap a on g.groupid=a.groupid
Left join articles b
to
pull the groups into a list of checkboxes and check them accordingly upon
edit. So, this is what I have as a basis to work on assuming I am polling
article #36.
Select *, if(b.articleid=36,1,0) as checked from groups g
Left join agmap a on g.groupid=a.groupid
Left join articles b on a.articleid
-
From: Adarsh Sharma adarsh.sha...@orkash.com
To: mysql@lists.mysql.com
Sent: Tuesday, 15 March, 2011 5:56:17 AM
Subject: Unexpected Select Output
Dear all,
Today I shoot a query to know the size of tables in a particular
database, but don't know why it prints only the output of only one
table
- Original Message -
From: Adarsh Sharma adarsh.sha...@orkash.com
I am able to fetch the output individually, but I try that I access
all information through one command :
mysql SELECT table_schema 'database',table_name 'Table', concat(
round( sum( data_length + index_length
Dear all,
I have prepared a simple script that shows the database, tables size in
the Database server as :-
Please check the attachment for the script output.
Now I just want to mail the output of my script to some persons e-mail-ID
Also, I want to do some calculations and provide the
- Original Message -
From: Adarsh Sharma adarsh.sha...@orkash.com
Please check the attachment for the script output.
Thanks for your password :-)
Now I just want to mail the output of my script to some persons
e-mail-ID
Assuming you run this from crontab, just set
Dear all,
Today I shoot a query to know the size of tables in a particular
database, but don't know why it prints only the output of only one
table. Here is my query output :
mysql SELECT table_schema 'database',table_name 'Table', concat( round(
sum( data_length + index_length ) / ( 1024
statements to get all of the results. That
to me is incredibly inefficient.
Is there any way to avoid this?
I'd like to be able to do this (only 3 OUT parameters in this example):
CREATE PROCEDURE productpricing(
OUT pl DECIMAL(8,2),
OUT ph DECIMAL(8,2),
OUT pa DECIMAL(8,2)
)
BEGIN
SELECT
One statement will do:
SELECT Min(prod_price) , Max(prod_price), Avg(prod_price) INTO pl, ph, pa
from products;
- michael dykman
On Mon, Feb 28, 2011 at 4:30 PM, mos mo...@fastmail.fm wrote:
I want to have a stored procedure that returns 5 columns from a table and do
some calculations
At 03:36 PM 2/28/2011, Michael Dykman wrote:
One statement will do:
SELECT Min(prod_price) , Max(prod_price), Avg(prod_price) INTO pl, ph, pa
from products;
- michael dykman
Michael,
Brilliant! Thanks. :-)
Mike
On Mon, Feb 28, 2011 at 4:30 PM, mos mo...@fastmail.fm wrote:
I
Hi,
I have a situation where I need clients to connect to a proxy server and to
then determine which MySQL server to forward their connection to based on
the username supplied. Does anyone know if this is possible using
mysql-proxy with Lua? Or by any other means?
Thanks.
REW
...@hotmail.com wrote:
Something like this might help you find all of the times where your user_id
switched to a different team_id:
select team_id, user_id, min(last_changed)
from
(select home_team_id as team_id, home_user_id as user_id, last_changed
from data
union all
select away_team_id
Greetings, all...
I'm having an issue with a SELECT in our system. We have an event log table,
with about 9 million rows in it. Inserts happen with some pretty high frequency,
and these selects happen periodically. The event_log table is MyISAM, the
rest of the tables are InnoDB.
What's
I had this same issue a while back and solved it by writing my events to
a disk-based file and periodically importing them into the event log
MyISAM table. This way, even if your select statements lock the table,
it won't affect the performance of your application. Of course, this
may
Do you delete data from the table ?
MyISAM will only grant a write lock when there are no locks on the table -
including implicit read locks. That may be your problem.
There is a single situation when concurrent reads and writes are possible on
MyISAM, however: when your table has no holes in
What columns do you have indexed on your event_log table? Can you post the
output from SHOW CREATE TABLE? How long does the query run for?
-Original Message-
From: Andy Wallace [mailto:awall...@ihouseweb.com]
Sent: Friday, February 04, 2011 10:29 AM
To: mysql list
Subject: Table/select
Hi,
I've the following list of sample data, and need a SELECT statement to help
me identify the point at which I've highlighted the data :
Season, Competition, home_team_id, away_team_id, home_user_id, away_user_id,
last_changed
1, 18, 11, 23, 3, 2010-11-14 17:18:17
1, 11, 8, 3, 82, 2010-11-14
Something like this might help you find all of the times where your user_id
switched to a different team_id:
select team_id, user_id, min(last_changed)
from
(select home_team_id as team_id, home_user_id as user_id, last_changed
from data
union all
select away_team_id as team_id, away_user_id
-Original Message-
From: LAMP [mailto:l...@afan.net]
Sent: Sunday, January 09, 2011 9:46 PM
To: mysql@lists.mysql.com
Subject: Re: export result from select statement
maybe it's clear to other but it's pretty unclear.
#mysql -username -p select * from table_name where id=123
'/home/me
-Original Message-
From: Michael Dykman [mailto:mdyk...@gmail.com]
Sent: Sunday, January 09, 2011 3:02 PM
To: LAMP; mysql@lists.mysql.com
Subject: Re: export result from select statement
I second Jerry's recommendation. It always works like a charm for me.
[JS] Thanks.
By the way
: 860.674.8341
E-mail: je...@gii.co.jp
Web site: www.the-infoshop.com
-Original Message-
From: LAMP [mailto:l...@afan.net]
Sent: Saturday, January 08, 2011 6:05 PM
To: mysql@lists.mysql.com
Subject: export result from select statement
Hi guys,
I wonder how to store to csv or txt file result from
: Saturday, January 08, 2011 6:05 PM
To: mysql@lists.mysql.com
Subject: export result from select statement
Hi guys,
I wonder how to store to csv or txt file result from SELECT query?
not a whole table nor database. Just results from SELECT query.
Usually I use MySQL Query Browser and Export feature
Eric Bergen wrote:
select into outfile is the correct way. What do you mean by doesn't
work? Does it give you an error?
It was an issue with permissions :-)
Thanks
On Sat, Jan 8, 2011 at 3:04 PM, LAMP l...@afan.net wrote:
Hi guys,
I wonder how to store to csv or txt file result from
maybe it's clear to other but it's pretty unclear.
#mysql -username -p select * from table_name where id=123
'/home/me/test/test.txt'
actually doesn't work?!?
Jerry Schwartz wrote:
The technique I've settled on is this:
mysql blah blah blah the_select_query.sql the_output_i_want.txt
#mysql -username -p -e select * from table_name where id=123
'/home/me/test/test.txt'
On Mon, Jan 10, 2011 at 8:15 AM, LAMP l...@afan.net wrote:
maybe it's clear to other but it's pretty unclear.
#mysql -username -p select * from table_name where id=123
'/home/me/test/test.txt'
actually
Hi guys,
I wonder how to store to csv or txt file result from SELECT query?
not a whole table nor database. Just results from SELECT query.
Usually I use MySQL Query Browser and Export feature, but in this
case I don't have access with MySQL Query Browser. Though, I have a
command line
select into outfile is the correct way. What do you mean by doesn't
work? Does it give you an error?
On Sat, Jan 8, 2011 at 3:04 PM, LAMP l...@afan.net wrote:
Hi guys,
I wonder how to store to csv or txt file result from SELECT query? not a
whole table nor database. Just results from SELECT
Hi,
why doesn't MySQL support selecting from the table being updated? The
following and any variations of it doesn't work:
UPDATE t1 (c1) VALUES (SELECT MAX(c1) FROM t1);
This restriction is documented here:
http://dev.mysql.com/doc/refman/5.5/en/update.html (at the very bottom)
Wouldn't
I can't tell you 'why' it is occurring when the field name begins with 4E5,
but you can solve your problem by enclosing all your field names
in backticks ( ` ).
IE:
SELECT field AS `4E5664736F400E8B482EA7AA67853D13`
On Mon, Dec 20, 2010 at 11:43 AM, Ramsey, Robert L
robert-ram
getting a select as statement right. Here is
the full query:
select
SUM(IF(image='EE0840D00E2ED8A317E5FA9899C48C19',1,0)) as
EE0840D00E2ED8A317E5FA9899C48C19,
SUM(IF(image='235C7987796D5B7CEBF56FBDA2BF7815',1,0)) as
235C7987796D5B7CEBF56FBDA2BF7815,
SUM(IF(image='96DC0562ED6E6F7FE789A18E09BC5889
i.e. just try this:
mysql select 4E5664736F400E8B482EA7AA67853D13;
ERROR 1367 (22007): Illegal double '4E5664736' value found during parsing
-Hank
On Mon, Dec 20, 2010 at 12:50 PM, Hank hes...@gmail.com wrote:
Here's my 5 second guess..
4E5664736... is being interpreted as a number
Yes! The illegal double error only happens if you do the select like you
did. The only error I was getting was the generic there's an error in your
sql.
Thank you!
Bob
From: Hank [mailto:hes...@gmail.com]
Sent: Monday, December 20, 2010 11:52 AM
To: Ramsey, Robert L
Cc: mysql
Thanks a lot. We will try and inform you.
--Original Message--
From: Aveek Misra
To: Albahar Uya
Cc: MySQL Lists
Subject: Re: select data from two tables and SUM qty of the same ID
Sent: Nov 10, 2010 17:38
SELECT product.ID, product.ProductName, product.ISBN, SUM(salesreport.QTY
SELECT product.ID, product.ProductName, product.ISBN, SUM(salesreport.QTY) as
Total_Quantity FROM salesreport, product WHERE product.ID = salesreport.ID
GROUP BY salesreport.ID ORDER BY Total_Quantity DESC;
On Nov 10, 2010, at 3:53 PM, HaidarPesebe wrote:
please help us look for the data
please help us look for the data select from two tables with the following
details:
Primary table: product
ID | ProductName | ISBN |
---
1 | Product A | 123 |
2 | Product B | 456 |
3 | product C | 444 |
---
second table
we've tried to use as your dialing purposes, but still can not.
This structure
SELECT product.product_id, product.isbn, product.name, product.author,
product.harga, product.discount, sum(sales_report.qty) as totalqty FROM .
$prefix . _sales_report, . $prefix . _product WHERE
I tried this and succeeded. Thank you
SELECT product_id, isbn, name, author, harga, discount, sum(qty) as totalqty
FROM . $prefix . _sales_report b INNER JOIN . $prefix . _product p ON
(p.product_id = b.bid) GROUP BY b.bid ORDER BY totalqty DESC
haidarpesebe
- Original Message -
From
I think this is one of those times you would update the mysql.user table
directly, then flush privileges.
JW
On Thu, Oct 14, 2010 at 6:46 PM, Daevid Vincent dae...@daevid.com wrote:
I'm pulling my hair out. How do I GRANT the SELECT ability to ANY USER for
the very specific
directly, then flush privileges.
JW
On Thu, Oct 14, 2010 at 6:46 PM, Daevid Vincent dae...@daevid.com wrote:
I'm pulling my hair out. How do I GRANT the SELECT ability to ANY USER
for
the very specific mysql.time_zone_name table?? I don't want to GRANT it
to
every individual user manually
, then flush privileges.
You can grant access to the time zone tables just as you would do to
any other table.
GRANT SELECT ON `mysql`.`time_zone_name` TO '%';
GRANT SELECT ON `mysql`.`time_zone_name` TO '%'@'%';
GRANT SELECT ON `mysql`.`time_zone_name` TO ''@'%';
GRANT SELECT ON `mysql
-Original Message-
From: Jesper Wisborg Krogh [mailto:jes...@noggin.com.au]
Sent: Friday, October 15, 2010 2:33 PM
To: MY SQL Mailing list
Subject: Re: How do I GRANT SELECT to mysql.time_zone_name
for ANYONE?!
Hi
On 16/10/2010, at 1:47 AM, Suresh Kuna wrote:
Hey Daevid
grant that automatically will apply to all users.
So if you have three users use...@localhost, use...@192.168.1.1, and
use...@localhost you have to run:
GRANT SELECT ON `mysql`.`time_zone_name` TO 'user_a'@localhost;
GRANT SELECT ON `mysql`.`time_zone_name` TO 'user_a'@192.168.1.1;
GRANT SELECT
-Original Message-
From: Jesper Wisborg Krogh [mailto:jes...@noggin.com.au]
Sent: Friday, October 15, 2010 5:54 PM
To: MY SQL Mailing list
Subject: Re: How do I GRANT SELECT to mysql.time_zone_name
for ANYONE?!
Any user can get into mysql, it's what they can do after that's
I'm pulling my hair out. How do I GRANT the SELECT ability to ANY USER for
the very specific mysql.time_zone_name table?? I don't want to GRANT it to
every individual user manually, I want one single GRANT that encompasses
every user simultaneously.
I've tried all of these, and they all are valid
Google has not been kind to me on this one, so I figured I would ask
here...
how can I select with NICE options, so that it doesn't KILL my server,
or any other queries...
Do you understand what I am asking?
Steve
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
At 10:49 AM 9/29/2010, Steve Staples wrote:
Google has not been kind to me on this one, so I figured I would ask
here...
how can I select with NICE options, so that it doesn't KILL my server,
or any other queries...
Do you understand what I am asking?
Steve
Steve,
You might look at http
Hi
With a SELECT * FROM my_table WHERE record_id IN (3,4,5,6,7,3), how can I
return two records for the record_id 3 ? Is it possible ?
Cheers
Neil
If there are two, you will return two.
On Tue, Sep 21, 2010 at 5:33 PM, Tompkins Neil neil.tompk...@googlemail.com
wrote:
Hi
With a SELECT * FROM my_table WHERE record_id IN (3,4,5,6,7,3), how can I
return two records for the record_id 3 ? Is it possible ?
Cheers
Neil
--
Bier met
Meersman vegiv...@tuxera.bewrote:
If there are two, you will return two.
On Tue, Sep 21, 2010 at 5:33 PM, Tompkins Neil
neil.tompk...@googlemail.com wrote:
Hi
With a SELECT * FROM my_table WHERE record_id IN (3,4,5,6,7,3), how can I
return two records for the record_id 3 ? Is it possible
two.
On Tue, Sep 21, 2010 at 5:33 PM, Tompkins Neil
neil.tompk...@googlemail.com wrote:
Hi
With a SELECT * FROM my_table WHERE record_id IN (3,4,5,6,7,3), how can I
return two records for the record_id 3 ? Is it possible ?
Cheers
Neil
--
Bier met grenadyn
Is als mosterd by den
...@googlemail.com wrote:
Hi
With a SELECT * FROM my_table WHERE record_id IN (3,4,5,6,7,3), how can
I
return two records for the record_id 3 ? Is it possible ?
Cheers
Neil
--
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel
On 21/09/2010 16:44, Tompkins Neil wrote:
Thanks for the quick reply. Basically in (3,4,5,6,7,3) the record_id of 3
only exists once in the table my_table. However, because 3 exists twice
within (3,4,5,6,7,3), I want it to return two records for record_id 3. Is
it possible ?
No, that isn't
Hi Neil, all!
Tompkins Neil wrote:
Hi
With a SELECT * FROM my_table WHERE record_id IN (3,4,5,6,7,3), how can I
return two records for the record_id 3 ? Is it possible ?
This is a case where you may safely use natural language and logic. The
command is
SELECT all fields FROM
-Original Message-
From: Tompkins Neil [mailto:neil.tompk...@googlemail.com]
Sent: Tuesday, September 21, 2010 11:48 AM
To: Johan De Meersman
Cc: [MySQL]
Subject: Re: SELECT WHERE IN help
Thanks for the reply. The search of (3,4,5,6,7,3) is pulling data from a
table. I think
@lists.mysql.com
Subject: Complex Select Query
Hi;
I have the following query:
select * from spreadsheets s join products p on p.Item=s.Item join
categories c on p.Category=c.ID where s.Client=%s order by p.category,
c.parent;
mysql describe products
Hi;
I have the following query:
select * from spreadsheets s join products p on p.Item=s.Item join
categories c on p.Category=c.ID where s.Client=%s order by p.category,
c.parent;
mysql describe products;
+-+--+--+-+-++
| Field | Type
://www.artfulsoftware.com/mysqlbook/sampler/mysqled1ch20.html and
http://www.artfulsoftware.com/infotree/treequeryperformance.pdf.
PB
-
-Original Message-
From: Victor Subervi victorsube...@gmail.com
Sent: Aug 24, 2010 1:14 PM
To: mysql@lists.mysql.com
Subject: Complex Select Query
: Victor Subervi victorsube...@gmail.com
Sent: Aug 24, 2010 1:14 PM
To: mysql@lists.mysql.com
Subject: Complex Select Query
Hi;
I have the following query:
select * from spreadsheets s join products p on p.Item=s.Item join
categories c on p.Category=c.ID where s.Client=%s order by p.category
hello ash...@pcraft.com;
where is the solution:
You have table A, so copy the entire table in another table. Table B.
so Table A=Table B (only in data no constrains)
then [id]=id you want to search
Untitled
select B.cod,count(*) entrysA from A,B where
A.atrib1=B.atrib1 and
A.atrib2=B.atrib2
On Mon, 19 Jul 2010 10:36:40 -0600
Ashley M. Kirchner ash...@pcraft.com wrote:
mysql select * from table where id='1';
+---+-+-+---+
| 1 | 123 | 0.0 | C |
| 1 | 234 | 0.1 | D |
| 1 | 345 | 0.0 | D |
| 1 | 456 | 0.1 | C |
| 1 | 567 | 0.1 | G
|
| 4 | 123 | 0.0 | C |
| 4 | 234 | 0.1 | D |
| 4 | 345 | 0.0 | D |
+---+-+-+---+
mysql select * from table where id='1';
+---+-+-+---+
| 1 | 123 | 0.0 | C |
| 1 | 234 | 0.1 | D |
| 1 | 345 | 0.0 | D |
| 1 | 456 | 0.1 | C |
| 1 | 567 | 0.1 | G
Not quite sure what the question is.
from:
mysql select * from table where id='1';
+---+-+-+---+
| 1 | 123 | 0.0 | C |
| 1 | 234 | 0.1 | D |
| 1 | 345 | 0.0 | D |
| 1 | 456 | 0.1 | C |
| 1 | 567 | 0.1 | G |
+---+-+-+---+
How do we deduce
| 456 | 0.1 | C |
| 3 | 567 | 0.1 | G |
| 4 | 123 | 0.0 | C |
| 4 | 234 | 0.1 | D |
| 4 | 345 | 0.0 | D |
+---+-+-+---+
mysql select * from table where id='1';
+---+-+-+---+
| 1 | 123 | 0.0 | C |
| 1 | 234 | 0.1 | D |
| 1 | 345 | 0.0 | D
On 7/19/2010 10:48 AM, Michael Dykman wrote:
Not quite sure what the question is.
from:
mysql select * from table where id='1';
+---+-+-+---+
| 1 | 123 | 0.0 | C |
| 1 | 234 | 0.1 | D |
| 1 | 345 | 0.0 | D |
| 1 | 456 | 0.1 | C |
| 1 | 567 | 0.1 | G
On 7/19/2010 11:08 AM, Shawn Green (MySQL) wrote:
Just because someone hands you a set of data to *start* with, does not
mean that you must only use that data to *work* with.
You should be able create additional tables derived from the original
data and work with those as part of your
Ashley,
I can't go back to the client and tell them their schema
is really messed up and to store their data differently.
You can hope that's not not necessary in order to deliver the requested
query, but it's a bad mistake to rule it out altogether, since it often
happens that
AND ', histUnixTime, ' ');
PREPARE s1 FROM @sql;
EXECUTE s1;
SELECT ROW_COUNT() INTO dropCnt;
DEALLOCATE PREPARE s1;
...
The problem here is that SELECT ROW_COUNT() INTO dropCnt; returns NULL
every time.
If I just do the select without
= ', iID, ' AND
clock BETWEEN 0 AND ', histUnixTime, ' ');
PREPARE s1 FROM @sql;
EXECUTE s1;
SELECT ROW_COUNT() INTO dropCnt;
DEALLOCATE PREPARE s1;
...
The problem here is that SELECT ROW_COUNT() INTO dropCnt; returns NULL
Walmart
pear 2 1 Walmart
(Note: both vendors 1 and 3 have the same cost which is the lowest. I'm not
really concerned with which vendor is chosen in the result set here.)
If I do: select a.type, min(a.cost), a.vendor_id, b.vendor_name from
Walmart
(Note: both vendors 1 and 3 have the same cost which is the lowest. I'm not
really concerned with which vendor is chosen in the result set here.)
If I do: select a.type, min(a.cost), a.vendor_id, b.vendor_name from
products a join vendors b on a.vendor_id = b.vendor_id group
in the result set here.)
Try this:
select name, product_type, min(cost) from vendors join products on
vendors.id = products.vendor_id group by product_type;
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql
Date: Wed, 14 Jul 2010 10:25:22 -0400
Subject: Select w/ group by question
From: smulle...@gmail.com
To: mysql@lists.mysql.com
I'm having trouble formulating a query to gather the following data. I can
do this via a script, but now it is more or less just bothering me
Peter
Thanks for the link. I've never run across this page before, but it has
tons of useful informationas well as several answers on how to implement
what I was trying to do.
Ended up going with a solution similar to this example (from the page you
referenced):
SELECT
item,
SUBSTR
On 7/8/2010 10:59 AM, John Nichel wrote:
Hi,
I'm hoping what I'm trying to do can be done, but I can't seem to find
the right syntax. I have the following query:
SELECT
... snipped
On Fri, Jul 9, 2010 at 9:09 PM, Andrés Tello mr.crip...@gmail.com wrote:
Hi, I'm using mysql 4.1.21, a legacy system. Next step to migrate it, but
for now, I need the community help.
I have a 23GB table, if I do a select count(over_an_index) from table it
uses 1.4minutes to read. The main
As usual, after you send a mail, you check for other things
From the 32GB of ram, I only was allocating 2G, not by the process, but by
all the S.O...
free -G reported barely 1 gig of ram...
XD - happy face that I have lots of ram...
now my face is like: ¬¬ - why I didn't verfy the amount of
Hi, I'm using mysql 4.1.21, a legacy system. Next step to migrate it, but
for now, I need the community help.
I have a 23GB table, if I do a select count(over_an_index) from table it
uses 1.4minutes to read. The main issue is that this table is the main table
of a system and each query is taking
Hi,
I'm hoping what I'm trying to do can be done, but I can't seem to find
the right syntax. I have the following query:
SELECT
a.productid,
a.productcode,
a.product
Is there a way I
can do a IF((SELECT.), expr2, expr3) and have expr2 populate with
whatever is returned from the select statement?
Yes, select if( (select count(*) from mytable ) 100, 1, 0) works fine.
The alias inside your last If(...), though, is not visible outside its
parentheses
-Original Message-
From: Peter Brawley [mailto:peter.braw...@earthlink.net]
Sent: Thursday, July 08, 2010 12:27 PM
To: mysql@lists.mysql.com
Subject: Re: Problem with IF() inside of a select statement
Is there a way I
can do a IF((SELECT.), expr2, expr3) and have expr2
It seems that there is no direct support to limit 'select' to only the
first N rows in a table. Could you let me know what the best way
select rows from the first N rows in a table is?
--
Regards,
Peng
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe
It seems that there is no direct support to limit 'select' to only the
first N rows in a table. Could you let me know what the best way
select rows from the first N rows in a table is?
LIMIT usually works fine ;-)
http://dev.mysql.com/doc/refman/5.0/en/select.html
With regards,
Martijn
In the last episode (Apr 27), Martijn Tonies said:
It seems that there is no direct support to limit 'select' to only the
first N rows in a table. Could you let me know what the best way select
rows from the first N rows in a table is?
LIMIT usually works fine ;-)
http://dev.mysql.com
In the last episode (Apr 27), Martijn Tonies said:
It seems that there is no direct support to limit 'select' to only the
first N rows in a table. Could you let me know what the best way
select
rows from the first N rows in a table is?
LIMIT usually works fine ;-)
http
I'm frankly not sure if this is a MySQL question or PHP, but I thought I
would start here.
I have a form that I have a (ever growing) list of checkboxes, Here is a
sample of the code for it.
input name=keyword[] type=checkbox value=fox /
It seems to go in, when I say seems to, I get a
This is a PHP question.
-Original Message-
From: Gary [mailto:g...@paulgdesigns.com]
Sent: Tuesday, April 20, 2010 3:17 PM
To: mysql@lists.mysql.com
Subject: Getting Array to display on SELECT
I'm frankly not sure if this is a MySQL question or PHP, but I thought I
would start here.
I
to display on SELECT
Date: Tue, 20 Apr 2010 18:16:52 -0400
I'm frankly not sure if this is a MySQL question or PHP, but I thought I
would start here.
I have a form that I have a (ever growing) list of checkboxes, Here is a
sample of the code for it.
input name=keyword[] type=checkbox
Make parent_id a unique key. Doing a select first and inserting if no
result will work 99.9% of the time; however, consider 2 rows being
inserted at the same time.
JW
On Tuesday, March 23, 2010, Kyong Kim kykim...@gmail.com wrote:
I need to INSERT a row into a table only if it does not exist
...@pixelated.net
Subject: Re: SELECT and INSERT if no row is returned
To: Kyong Kim kykim...@gmail.com
Cc: mysql mysql@lists.mysql.com
Date: Wednesday, March 24, 2010, 9:32 AM
Make parent_id a unique key. Doing a select first and inserting if no
result will work 99.9% of the time; however, consider 2 rows
(child_id)
) ENGINE=INNODB;
The requirement is that there can be only 1 parent_id associated with a
given child or there can be only one parent_id not associated with a
child_id (NULL child_id). I need to avoid a race condition where 2
connections can SELECT and return an empty row and insert rows
, seq_id),
UNIQUE KEY(child_id)
) ENGINE=INNODB;
The requirement is that there can be only 1 parent_id associated with a
given child or there can be only one parent_id not associated with a
child_id (NULL child_id). I need to avoid a race condition where 2
connections can SELECT and return an empty row
I need to INSERT a row into a table only if it does not exist to
insure that there won't be duplicate rows.
Due to the the usage case and the design of the primary key,
non-unique id + auto increment, I don't think insert ignore is an
option.
What would be simplest and cheapest way to make sure
DEFAULT '',
`mem` char(1) DEFAULT '',
PRIMARY KEY (`mid`),
KEY `key03` (`ordno`))
select * from t1 where ordno=' '
gets wrong result 2 rows
2CREATE TABLE `t1` (
`mid` int(11) NOT NULL,
`qty` decimal(12,2) NOT NULL DEFAULT '0.00',
`ordno` char(8) NOT NULL DEFAULT '',
`mem` char(1
Wang,
select * from t1 where ordno=' '
gets wrong result 2 rows
I doubt you'll get many helpful responses till you post the INSERTs.
PB
-
wang shuming wrote:
Oh,
If any char fields add to index key ,then the =' ' gets wrong .
ordno, qty ,mem
1
3
Hi,
select * from t1
ordno qty
1
3
5
'aaa' 18
'b' 20
select * from t1 where ordno=' ' or ordno' '
ordno qty
1
3
5
'aaa' 18
'b' 20
select * from t1 where ordno=' '
ordno qty
'aaa' 18
'b
In the last episode (Mar 04), wang shuming said:
select * from t1
ordno qty
1
3
5
'aaa' 18
'b' 20
Are your first three rows really blank, or are there nonprintable characters
in 'ordno' that aren't showing up here?
You need to provide us
Hi,
Any table with a ordno char(n) not null field
for example
ordno qty
35
0
1
'abc' 3
'000' 100
select * from table1 where ordno' ' or ordno=' '
3 rows
select * from table1 where ordno=' '
0 rows
best regard!
Shuming
Hi,
Any table with a ordno char(n) not null field
for example
ordno qty
35
0
1
'abc' 3
'000' 100
select * from table1 where ordno' ' or ordno=' '
5 rows
select * from table1 where ordno=' '
2 rows
best regard!
Shuming
201 - 300 of 4787 matches
Mail list logo