2013/02/02 12:58 -0600, Peter Brawley
On 2013-02-01 10:18 PM, h...@tbbs.net wrote:
2013/01/31 22:24 -0600, Peter Brawley
Is this what you mean?
Select,
pricelist
If( !IsNull(specialprice) And specialprice unitprice And CurDate() Between
startingDate And endingDate,
specialprice,
unitprice
)
2013/01/31 22:24 -0600, Peter Brawley
Is this what you mean?
Select,
pricelist
If( !IsNull(specialprice) And specialprice unitprice And CurDate() Between
startingDate And endingDate,
specialprice,
unitprice
) as used_price
From catalog
Where itemid='WB314';
PB
Maybe this is gilding the
On 2013-02-01 10:18 PM, h...@tbbs.net wrote:
2013/01/31 22:24 -0600, Peter Brawley
Is this what you mean?
Select,
pricelist
If( !IsNull(specialprice) And specialprice unitprice And CurDate() Between
startingDate And endingDate,
specialprice,
unitprice
) as used_price
From catalog
Where
Hello,
I'm trying to write a select query that grabs two prices from my db and
displays them on a web page. I want it to grab the `listprice`, and either the
`unitprice` or the `specialprice` depending on the following criteria:
if the `specialprice` is not empty,
AND it's less than
On 2013-01-31 8:13 PM, Angela Barone wrote:
Hello,
I'm trying to write a select query that grabs two prices from my db and
displays them on a web page. I want it to grab the `listprice`, and either the
`unitprice` or the `specialprice` depending on the following criteria:
if the
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 and
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
Can you show the CREATE TABLE for your REF_SEQ table?
The explain output says using where which means that MySQL will have to
post-filter rows after the storage engine retrieves them. It also means the
query may benefit from different/better indexing.
On Mon, Jul 13, 2009 at 12:04 AM, TianJing
the REF_SEQ is defined below, the col DNA_SEQ is a string such as
ATGCGGTTA,
| REF_SEQ | CREATE TABLE `REF_SEQ` (
`SEQ_ID` int(11) NOT NULL auto_increment,
`REF_ID` int(11) NOT NULL,
`START_POSITION` int(11) NOT NULL,
`END_POSITION` int(11) NOT NULL,
`DNA_SEQ` text,
`DNA_QUALITY`
I see that index_ref_start is defined on Ref_Id and Start_Position. Mysql
only uses the left-most column of this index. Drop and re-add this key only
defined as
INDEX idx_ref_start(start_position)
and see if that helps.
Your explain you sent this time is not even using the index.
In your
sorry for my careless,the sql should be select * from REF_SEQ where REF_ID =
3 and START_POSITION between 3 and 803;
the explain output is :
mysql explain select * from REF_SEQ where REF_ID = 3 and START_POSITION
between 3 and 803;
It looks like MySQL is using both columns in the key for that query, since
the key_len is 8, but for some reason it says it is still using where.
What happens when you only select these fields: seq_id, ref_id,
start_position, end_position?
Does the query speed up? I had a table that had some
yes,it is more faster that i select every cols except the TEXT col,but
unfortunately i need the TEXT cols for next step.
2009/7/14 Johnny Withers joh...@pixelated.net
It looks like MySQL is using both columns in the key for that query, since
the key_len is 8, but for some reason it says it is
Hi all,
i use select * from table_name where start_postion between min_postion and
max_postion to select all the record in the ranges,
when the ranges is very large,such as 800(about 1000 record in it), the
query is so slow,
when i use mysql administrator i find that traffic is higher when
1. Don't use SELECT *. Only grab the cols that you only need. Also
make sure you have an index on min_position and max_position. After
that if your query isn't faster please show us the output of running
EXPLAIN select * from table_name where start_postion between
min_postion and
max_postion .
thanks for reply,
i hava an index on the start_position,the min_postion and the max_postion is
constant value, the output of the query is:
explain select * from REF_SEQ where START_POSITION between 3 and
803;
You are still doing SELECT * . Do you really need to return all of the
columns in that table or just COL1, COL2, COL5 for example. Only grab
the columns you are actually going to use.
On Mon, Jul 13, 2009 at 12:23 AM, TianJingtianj...@genomics.org.cn wrote:
thanks for reply,
i hava an index on
sorry fo that, but i really need all cols in the table, i think the problem
maybe caused by one of the col which is text type, each record of this col
has 2000 characters. this makes the size of record more biger.
2009/7/13 Darryle Steplight dstepli...@gmail.com
You are still doing SELECT * .
Numeric indexing is a lot faster. You definitely shouldn't use text or
varchar types as column types for you min and max values. Do an ALTER
TABLE on any column only hold numeric values and switch them to int
or mediumint.
On Mon, Jul 13, 2009 at 12:36 AM, TianJingtianj...@genomics.org.cn
i do not use text for start_postion,i use int for it. the only col which
defined to text is characters such as ABTGDSDFSGFDG etc.
2009/7/13 Darryle Steplight dstepli...@gmail.com
Numeric indexing is a lot faster. You definitely shouldn't use text or
varchar types as column types for you min
Hey,
In order for me to achive the goal of migrating a MS SQL based application
to web based php / mysql I need to understand a little bit MS SQL syntax
and
MySQL counterpart expression. If is not too much to ask one of you guys
could translate this MS SQL select to MySQL? Here's the
! Thanks!
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
--
View this message in context:
http://www.nabble.com/MS-SQL-to-MySQL-select-tp17846568p17859366.html
Sent from the MySQL - General
:
http://www.nabble.com/MS-SQL-to-MySQL-select-tp17846568p17846568.html
Sent from the MySQL - General mailing list archive at Nabble.com.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Changying Li schrieb:
why does mysql use group_id index ?
because in this case group_id would be faster than user_id
but in fact group_id is very slow (51.21 sec), user_id is (0.00 sec)
ok, at least MySQL does think so
I know, but I what I really want to know is how does mysql think so ?
|
group_id | 6 | NULL | 16567648 | Using where; Using index |
++-+---+---+---+--+-+--+--+--+
1 row in set (0.00 sec)
mysql select count(*) from photo where group_id=0 and album_id!=0
|
++-+---+--+---+--+-+---+--+-+
1 row in set (0.00 sec)
mysql select * FROM photo WHERE ( album_id != '0' AND banned =
'0' AND group_id = '0' AND photo_id '27103315' AND rating !=
'1' AND user_id = '882092' ) ORDER BY photo_id LIMIT 50;
Empty set (51.21 sec)
mysql explain
| user_id | user_id | 4 |
const,const | 1694 | Using where; Using filesort |
++-+---+--+---+-+-+-+--+-+
1 row in set (0.00 sec)
mysql select * FROM photo use index (user_id) WHERE ( album_id
|
++-+---+--+---+--+-+---+--+-+
1 row in set (0.00 sec)
mysql select * FROM photo WHERE ( album_id != '0' AND banned =
'0' AND group_id = '0' AND photo_id '27103315' AND rating !=
'1' AND user_id = '882092' ) ORDER BY photo_id LIMIT
|
++-+---+--+---+--+-+---+--+-+
1 row in set (0.00 sec)
mysql select * FROM photo WHERE ( album_id != '0' AND banned = '0'
AND group_id = '0' AND photo_id '27103315' AND rating != '1' AND
user_id = '882092' ) ORDER BY photo_id LIMIT 50;
Empty set (51.21
why does mysql use group_id index ?
because in this case group_id would be faster than user_id
but in fact group_id is very slow (51.21 sec), user_id is (0.00 sec)
ok, at least MySQL does think so
I know, but I what I really want to know is how does mysql think so ?
how to let mysql choose
Hi List,
I am wondering if someone can help me with a query to check what databases
are on the MySQL server and then check which of those databases are either
partially or completely within the date range i require.
The scenario is as follows:
db1 : 2007-01-01 to 2007-02-01
db2 : 2007-02-01 to
Sounds like you should create a MERGE table that links all the
underlying tables together. Then you just query the merge table and
MySQL handles which tables it needs to pull data from. You also then
don't need to query for the tables.
On Jan 9, 2008, at 9:12 AM, Cx Cx wrote:
Hi List,
I
Hi!
System is Novell SBS 6.5 sp1 with Apache 2.0.48, MySQL ver. 4.0.15a,
PHP 4.2.3.
We try to define a select query that takes the values of the variables
'varKoshi' and 'varKvish' based on the following 4 tables:
'varKoshi' vv 'varKvish'
Nanu Kalmanovitz wrote:
Hi!
System is Novell SBS 6.5 sp1 with Apache 2.0.48, MySQL ver. 4.0.15a,
PHP 4.2.3.
We try to define a select query that takes the values of the variables
'varKoshi' and 'varKvish' based on the following 4 tables:
'varKoshi' vv 'varKvish'
Hi,
I have a problem about writing a proper SELECT query
for the following goal: (I only have basic knowledge
of SQL)
Table name: peoplelist
column 1: id (not NULL, auto_incremental)
column 2: name
column 3: country
now, there are about 7,000 rows in this table. I want
to select out:
first
Try something like this:
SELECT ID, Name, Country
FROM peoplelist
GROUP BY Country
HAVING count(Country)10;
That might work. Also you can have subselects in 4.0.
sub selects are only in 4.1 I thought?
On Mar 3, 2004, at 5:08 PM, Jacque Scott wrote:
Also you can have subselects in 4.0.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
You are correct. Sorry about that.
charles kline [EMAIL PROTECTED] 3/3/2004 2:46:51 PM
sub selects are only in 4.1 I thought?
On Mar 3, 2004, at 5:08 PM, Jacque Scott wrote:
Also you can have subselects in 4.0.
When a select query is run on a mysql table with text and blob fields, the
text fields return the whole text but the blob fields return only the first
4 bytes of the blob data. I use MySQL 4.0.17 with VB6.0 on Windows 2000.
What should I do to retrieve complete data from the blob field?
Any help
I have the follow MySQL queries for pulling out ans then inserting a
record from
a record set. Unfortunately I think I have missed something (vital) as the
record being inserted is the value and not the name, for example 1 instead of
blue... can someone kindly have a look and spot where I have
I understand the SQL statement in MySQL to be SELECT sum(column name) FROM table;
but I would like to get a SUM of multiple columns. Is this possible??
Thanks,
Ryan
-
Before posting, please check:
* Stevens, Ryan
I understand the SQL statement in MySQL to be SELECT sum(column
name) FROM table; but I would like to get a SUM of multiple
columns. Is this possible??
Yes. You can add multiple columns inside the SUM() function:
SELECT SUM(col1+col2+col3) FROM table;
--
Roger
sql
SELECT SUM(colA+colB) FROM TABLE ?
Stevens, Ryan wrote:
I understand the SQL statement in MySQL to be SELECT sum(column name) FROM table;
but I would like to get a SUM of multiple columns. Is this possible??
Thanks,
Ryan
On Mon, 2003-01-13 at 14:11, Stevens, Ryan wrote:
I understand the SQL statement in MySQL to be
SELECT sum(column name) FROM table; but I would like to get a
SUM of multiple columns. Is this possible??
Yes, you may use:
SELECT sum(c1+c2) FROM table;
or even:
SELECT sum(table1.v +
Vinay,
Wednesday, December 04, 2002, 3:05:03 PM, you wrote:
VM I m developing a web based application using Tomcat, Struts, JSP, mysql.
VM I m using mysql 3.23.39-max-nt and mysql-connector-java-2.0.14 to access
VM mysql through java 1.3.1.
VM But sometimes the select query on 1 particular
Hi,
I m developing a web based application using Tomcat, Struts, JSP, mysql.
I m using mysql 3.23.39-max-nt and mysql-connector-java-2.0.14 to access
mysql through java 1.3.1.
But sometimes the select query on 1 particular table returns less no of rows
than the actual.
Most of the times it
select * from processo_arquivos order by DATE desc limit 10
-Original Message-
From: Felipe Moreno - MAILING LISTS [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 12:42 PM
To: [EMAIL PROTECTED]
Subject: MySQL: Select HELP!
Importance: High
Hi List Users,
I want to know
Just wondering if anyone knows of a work around for selecting rows in Table1
that have an ID column value which is not found in the ID column of Table2.
I have seen a workaround for selecting similar rows IN both tables, but I
want NOT IN.
This would be a work around to the sql subselect query in
Heesestr. 6, 12169 Berlin (Germany)
Tel: +49 30 7970948-0 Fax: +49 30 7970948-3
- Original Message -
From: Henning Sittler [EMAIL PROTECTED]
To: 'mysql users' [EMAIL PROTECTED]
Sent: Tuesday, December 03, 2002 3:16 PM
Subject: MySQL: Select Not In Table
Just wondering if anyone knows
SELECT Table1.ID FROM Table1 LEFT JOIN Table2 ON Table1.ID = TRable2.ID
where Table2.ID IS NULL;
Henning Sittler wrote:
Just wondering if anyone knows of a work around for selecting rows in Table1
that have an ID column value which is not found in the ID column of Table2.
I have seen a
Thanks to all those who have responded! This is the sql query I am looking
for. It's good to have such a user mail list.
SELECT Table1.ID FROM Table1 LEFT JOIN Table2 Using(ID)
WHERE Table2.ID IS NULL
when you do a left join, if there is no cooresponding row in the second
table, then a
Hi List Users,
I want to know if anyone has any idea on how can I do the SQL command
below to archive a result.
I have one table called processo_arquivos that have a filed called DATE
and another FIELD called COD (primary key). I want to select the last TEN
(10) dates from the Database, but
SELECT Table1.ID FROM Table1 LEFT OUTER JOIN Table2 ON
Table1.ID=Table2.ID
WHERE Table2.ID IS NULL;
-Original Message-
From: Henning Sittler [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 10:16 AM
To: 'mysql users'
Subject: MySQL: Select Not In Table
Just
SELECT * FROM processo_arquivos ORDER BY DATE DESC LIMIT 0,10
-Original Message-
From: Felipe Moreno - MAILING LISTS [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 1:42 PM
To: [EMAIL PROTECTED]
Subject: MySQL: Select HELP!
Importance: High
Hi List Users,
I
Try this:
SELECT DATE, COD FROM processo_arquivos ORDER BY DATE DESC LIMIT 10
Unfortunately, that puts them in reverse order. There's probably a
better way, with a more sophisticated use of the LIMIT keyword, that
puts them in the right order.
-Alex
On Tuesday, December 3, 2002, at 10:41
by now, i hope, you've gotten answers from the
sql gurus on the list, so i won't clutter with my
humble attempts.
your comment about problems with joins indicates
that corereader might be of some help to you if
you have a windows box for a front end. it will
let you do quick
Eric,
Friday, November 15, 2002, 1:36:54 AM, you wrote:
EA Assume two tables:
EA CREATE TABLE block_ip (
EA datestamp int(11) NOT NULL default '0',
EA remote_addr char(15) NOT NULL default '',
EA PRIMARY KEY (remote_addr),
EA KEY datestamp (datestamp)
EA ) TYPE=MyISAM;
EA CREATE TABLE
Assume two tables:
CREATE TABLE block_ip (
datestamp int(11) NOT NULL default '0',
remote_addr char(15) NOT NULL default '',
PRIMARY KEY (remote_addr),
KEY datestamp (datestamp)
) TYPE=MyISAM;
CREATE TABLE brute_force (
datestamp int(11) NOT NULL default '0',
remote_addr char(15)
Hi,
It's my first post here so excuse me if I'm a little vague.
For this example I have two tables; 'songs' that contains an ID of the track
and name (and other info we don't need to know) and 'setlists' which is a
link table for other tables, which for this purpose don't matter.
'Setlists' has
Kent,
Thursday, July 11, 2002, 9:22:52 PM, you wrote:
KH I would use this query:
KH SELECT DISTINCT SUBSTRING(email,LOCATE('@', email) ) FROM AddressList ;
So?
Syntax of your SQL statement is correct.
--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This
I would use this query:
SELECT DISTINCT SUBSTRING(email,LOCATE('@', email) ) FROM AddressList ;
Cheers,
Kent
sql, query, y'hear
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
Easy question I hope, relatively new user ( 6 months) here wanting to know
how to fashion a MySQL
select statement based on the following:
there is a list of managers and their email addresses. This list changes
all the time as we add and subtract different companies from the db. I
would like
Use SELECT DISTINCT.
Matthew Scarrow
ComIT Solutions Inc.
www.comit.ca
Phone: 519-442-0100
Fax: 519-442-0429
-Original Message-
From: Kirk Babb [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 10, 2002 9:59 PM
To: [EMAIL PROTECTED]
Subject: help with MySQL SELECT statement
Easy
wait, how will the MySQL SELECT DISTINCT pick only one between these two
addresses (as an example):
[EMAIL PROTECTED]
[EMAIL PROTECTED]
I only need one email address each for alltel.com, one for ualr.edu, one for
target.com, etc. when there might be 50 email addresses from each of those
domains
with MySQL SELECT statement
wait, how will the MySQL SELECT DISTINCT pick only one between these two
addresses (as an example):
[EMAIL PROTECTED]
[EMAIL PROTECTED]
I only need one email address each for alltel.com, one for ualr.edu, one for
target.com, etc. when there might be 50 email addresses
On 18 Jun 2002 at 16:36, Walter D. Funk wrote:
Hi everybody!
I need to count the ACTIVE users of my Mysql users table; where 'active' is
a flag showing this status,
using the following query it returns all the user in the table, and I need
only those who have tha flag active set to 'Y'
Hi everybody!
I need to count the ACTIVE users of my Mysql users table; where 'active' is
a flag showing this status,
using the following query it returns all the user in the table, and I need
only those who have tha flag active set to 'Y'
I know this could be done by using a where clause, but
You may try:
SELECT SUM( IF( STRCMP( active,'Y' ) = 0, 1, 0 ) ) as activeUsers
FROM usersTbl
On Tuesday 18 June 2002 16:36, Walter D. Funk wrote:
Hi everybody!
I need to count the ACTIVE users of my Mysql users table; where 'active' is
a flag showing this status,
using the following
On 18 Jun 2002, at 17:36, João Paulo Vasconcellos wrote:
SELECT SUM( IF( STRCMP( active,'Y' ) = 0, 1, 0 ) ) as activeUsers
FROM usersTbl
Since comparisons return 1 or 0, a simpler way of writing that
query is
SELECT SUM( active = 'Y' ) as activeUsers FROM usersTbl
(although things are
Greetings List,
Using mysql, after doing a query using the select * statement, how do
is place this into a hash? Or a
text file for that matter? There must be a rather simple answer around.
Your input is most apprecitated.
Tom
At 4:06 PM -0600 8/23/01, Tom Burkhardt wrote:
Greetings List,
Using mysql, after doing a query using the select * statement, how do
is place this into a hash? Or a
text file for that matter? There must be a rather simple answer around.
There may be, but your message doesn't contain enough
Can somebody please point me to the good resourse of learning mysql's
SELECT command on the Internet?
Thanks,
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/
On Thu, 14 Jun 2001 13:50:43 -0300, Nasir Ali [EMAIL PROTECTED] wrote:
Well as they say, ...if all else fails, RTFM.. :) Or pick up Paul Dubois's
book on MySQL.
Can somebody please point me to the good resourse of learning mysql's
SELECT command on the Internet?
Thanks,
!!
-Original Message-
From: Nasir Ali [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 14, 2001 9:51 AM
To: [EMAIL PROTECTED]
Subject: Mysql SELECT command
Can somebody please point me to the good resourse of learning mysql's
SELECT command on the Internet?
Thanks
From Beyond-Security's SecuriTeam.com(The information has been provided by Tharbad):
A security vulnerability in MySQL, a database management system, has been discovered.
This vulnerability allows remote attackers to crash by issuing a SELECT statement
containing a large amount of characters.
Hello.
Thank you for your contribution, but this issue has already been
discussed on this list (see the archive) and a fix is available (since
3.23.21).
Bye,
Benjamin.
On Fri, Feb 02, 2001 at 01:23:26AM +0300, [EMAIL PROTECTED] wrote:
From Beyond-Security's SecuriTeam.com(The
82 matches
Mail list logo