Hi Rafael,
You can try using correlated subquery instead of outer join. This can be slow
with big tables though:
SELECT * FROM users WHERE accept_email = 1 and email not in (SELECT email FROM
sent_emails WHERE sent_emails
.email = users.email AND messageID NOT LIKE = ‘XX’)
OR OUTER JOIN as
Dear Friends,
I m new on this list, and I m trying to learn more about mysql.
After perform a lot of searchs in the Internet, I have no answer to my
question and would like to ask your help.
I wanna a perform a query that depends of the result from another (query)
table inside the same
Try this:
SELECT RMAs.rma_id FROM RMAs, rma_line_items
WHERE TO_DAYS(date_settled) = 733274
AND RMAs.rma_id = rma_line_items.rma_id
GROUP BY RMAs.rma_id HAVING COUNT(*) > 1
On Sep 10, 2007, at 11:36 PM, Mike Mannakee wrote:
I have two tables, one called RMAs and the other called
rma_line_item
I have two tables, one called RMAs and the other called rma_line_items. The
first one has the general details of the RMA (Return Merchandise
Authorization) , the second holds the details of each item being returned.
What I want is a listing of the RMA ids (which are unique in the RMAs table)
w
On Wed, 2007-01-17 at 11:47 -0600, Peter Brawley wrote:
> Daniel,
>
> CREATE TABLE tbl (
> lab_number int(11) default NULL,
> result int(11) default NULL,
> release_time datetime default NULL
> );
> select * from tbl;
> +++-+
> | lab_number | result |
Daniel,
CREATE TABLE tbl (
lab_number int(11) default NULL,
result int(11) default NULL,
release_time datetime default NULL
);
select * from tbl;
+++-+
| lab_number | result | release_time|
+++-+
|
On Wed, 2007-01-17 at 09:56 -0600, Peter Brawley wrote:
> Daniel,
>
> >find the lab_number where ALL the tests have been performed and
> >not the lab_numbers which have partial results.
>
> SELECT t1.lab,t1.res,t1.dt
> FROM tbl t1
> WHERE NOT EXISTS(
> SELECT lab FROM tbl t2 WHERE t1.lab=t2.lab
Daniel,
find the lab_number where ALL the tests have been performed and
not the lab_numbers which have partial results.
SELECT t1.lab,t1.res,t1.dt
FROM tbl t1
WHERE NOT EXISTS(
SELECT lab FROM tbl t2 WHERE t1.lab=t2.lab AND t2.res IS NULL
);
The decorrelated version uses an exclusion join, r
I have a table with numerous columns but needing to perform a query
based on three columns:
Lab_number, result, release_time.
What I want to do is search for lab_number where there is a result but
not released. The problem that is making this difficult for me, is that
there are multiple entries
>-Original Message-
>From: VenuGopal Papasani [mailto:[EMAIL PROTECTED]
>Sent: Monday, March 13, 2006 11:48
>To: Jeff
>Subject: Re: Help regarding a simple query
>
>
>Hi Jeff,
> This is venu again.Last mail i did not include a constraint that is
what irritatin
Now i need to get all the records which consists of the string
venu(case should not be considered either case should be).i.e i should get
1,2,3,4,5,8 records
A simple way is ...
...
WHERE LOCATE('venu', col_name ) > 0
...
or if the column is [VAR]BINARY, LOCATE('venu',CAST(col_name
> -Original Message-
> From: VenuGopal Papasani [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 13, 2006 10:33
> To: mysql@lists.mysql.com
> Subject: Help regarding a simple query
>
>
> Hi,
> I am searching for a query where i can have pattern
> ma
Hi,
I am searching for a query where i can have pattern matching without
considering the cases.You can consider the following example for detailed
description of what i want exactly.
Let my table X consists of following data
Name
---
venu
venup
venugopla
VenugOpal
VENU
pap
UPDATE forums_members,members
SET forums_members.active=members.active
WHERE
forums_members.member_id = members.id
Oh, I see. I now feel a little foolish as I should have grasped that.
For some reason I assumed that by specifying where to get the data from,
it would be assumed that's what t
2005/9/15, Dave <[EMAIL PROTECTED]>:
> MySQL General List,
>
> Server specifications:
> MySQL 4.1.3-beta, phpMyAdmin 2.5.7-pl1, PHP 4.3.8
> My specifications:
> MySQL beginner, PHP intermediate, HTML and CSS advanced.
>
> The situation:
> I have two tables, one old, and one new. In bo
MySQL General List,
Server specifications:
MySQL 4.1.3-beta, phpMyAdmin 2.5.7-pl1, PHP 4.3.8
My specifications:
MySQL beginner, PHP intermediate, HTML and CSS advanced.
The situation:
I have two tables, one old, and one new. In both tables I have a
column called "active", which is either
> Creating a combined index can help MySQL in using this index for both the
> where condition and the order by clause.
> Try the query with an index on cat,date and with date,cat; maybe one will
be
> faster than the other.
This partially solved my problem. Thanks a lot. However I am facing a new
p
> Create composite index on (cat, date). Use EXPLAIN to see if MySQL uses
index:
> http://dev.mysql.com/doc/mysql/en/EXPLAIN.html
This partially solved my problem. Thanks a lot. However I am facing a new
problem here.
The query where I am ordering by a column is much more slowly than the same
que
> 1. MySQL only uses one index for each table in a JOIN; this query only
uses
> one table, so only one index is used.
> 2. DESC is slower than ASC
> 3. Try creating an index on two columns; try cat and date, and try date
and
> cat.
> 4. Check EXPLAIN SELECT id,name.. to see whether the right in
> select id,name,desc,cat,date from table where cat='12'
>
> however I need to order the results by date desc... I have indexes on both
> the cat and date (of type timestamp) fields however this operation is much
> more slowly when I used the order So the result is something like this
>
> selec
"Arthur Radulescu" <[EMAIL PROTECTED]> wrote:
>
> I have a simple query on a table of about 1,000,000 records... The table is
> optimized and the query is pretty simple at this moment... something like
> this
>
> select id,name,desc,cat,date from table where cat
Hello!
I have a simple query on a table of about 1,000,000 records... The table is
optimized and the query is pretty simple at this moment... something like
this
select id,name,desc,cat,date from table where cat='12'
however I need to order the results by date desc... I have indexes o
Hello!
I have a simple query on a table of about 1,000,000 records... The table is
optimized and the query is pretty simple at this moment... something like
this
select id,name,desc,cat,date from table where cat='12'
however I need to order the results by date desc... I have indexes o
e-
From: Larry Brown [mailto:[EMAIL PROTECTED]
Sent: 27 October 2003 22:30
To: Jim Matzdorff; MySQL List
Subject: RE: I can't figure out what I thought would be a simple query..
I'm interested to see what kind of solution is offered for this as I could
use it myself. I'm having to
ike the subselect method would have this problem
also. Can someone tell me if this is true or am I thinking wrong? Hmm.
Hope that helps.
Matt
- Original Message -
From: "Larry Brown"
Sent: Monday, October 27, 2003 4:29 PM
Subject: RE: I can't figure out what I thought w
PROTECTED]
Subject: I can't figure out what I thought would be a simple query..
All;
I am having tremendous trouble attempting to do the following query; and any
help would be appreciated.
I am using Mysql 4.0.15a; and I cannot upgrade.
Given the following TEMPORARY table (it's a table
All;
I am having tremendous trouble attempting to do the following query; and any
help would be appreciated.
I am using Mysql 4.0.15a; and I cannot upgrade.
Given the following TEMPORARY table (it's a table I have created from a whole
host of sources):
table: endtime_table
+
Hi Bruce,
yep, u r right.
Anyway, MySQL query optimizer will take care of it ;)
regds,
-Original Message-
From: Bruce Feist [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 02, 2003 04:00
To: [EMAIL PROTECTED]
Subject: Re: A Simple Query!
Hello, Uttam;
We can simplify this, actually
Working solution Bruce Feist
SELECT Films.idFilm, title
FROM Films LEFT JOIN Loans
ON (Films.idFilm = Loans.idFilm) AND (Loans.return_date IS NULL)
WHERE Loans.idFilm IS NULL;
Note: This solution works for me as it considers that I give no value (NULL) to
the attribute return_date at th
Hello, Uttam;
We can simplify this, actually... any time L.idFilm is NULL (i.e., no
row in Loans is found), L.dateReturn will have to be NULL as well. So,
specifying the L.idFilm IS NULL condition is redundant. It's sufficient
to look only at L.dateReturn IS NULL in the WHERE clause.
Yours i
ch 01, 2003 08:13
To: [EMAIL PROTECTED]
Subject: Re: A Simple Query!
Hello, Remi;
Try this; I *think* it'll work (but I'm also new to MySQL):
select F.idFilm, F.title
from Films F left join Loans L on F.idFilm = L.idFilm and L.dateReturn
IS NULL
where L.idFilm IS NULL;
This provides
Hello,
This is the way I normally do queries that would be solved with
sub-selects in other products:
SELECT F.idFilm, F.title
FROM Films F, Loans L
WHERE F.idFilm = L.idFilm
AND L.dateReturn IS NULL;
Sam A. Funk
At 02:27 + 03/01/03, Remi Mikalsen wrote:
Hello,
I believe, and hope, I have a
Hello, Remi;
Try this; I *think* it'll work (but I'm also new to MySQL):
select F.idFilm, F.title
from Films F left join Loans L on F.idFilm = L.idFilm and L.dateReturn
IS NULL
where L.idFilm IS NULL;
This provides an interesting example of the difference between "on" and
"where", by the way; it
Hello,
I believe, and hope, I have a very simple question, but as I am relatively new to
MySQL I might be missing out on the obvious solution.
Is it possible to use a single MySQL query (with the simple scheme presented) to
ask the following question?
Scheme:
Films (idFilm, title)
Loans (i
ySQL Mailing List
> Subject: a simple query
>
>
> Hi,
>
> I have a table like this:
>
> ---
> | Code | Name | ParentFemale | ParentMale |
> ---
> |1 | Child
Hi,
I have a table like this:
---
| Code | Name | ParentFemale | ParentMale |
---
|1 | Child| 2 | 3 |
---
|
SELECT * from hwu_articles WHERE id = '$id' and price is not null and name
is not null and ratings is not null;
Bhavin.
- Original Message -
From: "Alex Behrens" <[EMAIL PROTECTED]>
To: "MYSQL" <[EMAIL PROTECTED]>
Sent: Friday, August 02, 2002
Hi Guys,
I'm still new to this and I'm trying to get back into and I need help with a
simple query. I have a list of info about a product for an article on my
website and I'm pulling all this info from a mysql db and displaying it
byway of php but don't know how to do the que
Hi Guys,
I'm still new to this and I'm trying to get back into and I need help with a
simple query. I have a list of info about a product for an article on my
website and I'm pulling all this info from a mysql db and displaying it
byway of php but don't know how to do the que
Thanks a lot, it worked with the double datatype!
On Fri, 14 Jun 2002, Michael Ivanyo wrote:
> I've had similar problems with this in my career and
> have come to the conclusion that one should always use
> double floats. The problem is typically due to round
> off errors of the float
"select version();"
"show create table ...;"
- Original Message -
From: "Vandana" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 7:01 PM
Subject: A simple query, please help
>
> My table is as follows:
&g
My table is as follows:
Value Distance
(float) (float)
2.0 42.3
1.0 56.9
3.2 20.0
1.3 18.5
I issued a query,
'update ta
Try this. I couldn't find if MYSQL supports not in's so I followed there
outer joins. You can read up on in in the mysql manual, do a search on
outer joins.
select base.zipcode,properties.zipcode from base right join properties on
base.zipcode=properties.zipcode where base.zipcode is null;
On
> I have 2 tables:
>
> bases, and properties
>
> base has a ZIPCODE field in the table, as does the properties table.
>
> I'm trying to find all bases that do NOT have a property in that zip code.
>
> What I've tried is:
The general answer:
http://www.bitbybit.dk/mysqlfaq/faq.html#ch7_10_0
In yo
I have 2 tables:
bases, and properties
base has a ZIPCODE field in the table, as does the properties table.
I'm trying to find all bases that do NOT have a property in that zip code.
What I've tried is:
select distinct cb.*, cp.* from classified_bases as cb left join
classified_properties as
45 matches
Mail list logo