ido
=> Schlenke
=> Subject: Re: Complex Query
=>
=> >>>> 2011/05/21 00:22 +0200, Johan De Meersman >>>>
=> Heh. The parser is pointing out a simple syntax oversight, yes. The
=> correct syntax for that is select ... from (subselect) aliasname;
=> <<<
2011/05/21 00:22 +0200, Johan De Meersman
Heh. The parser is pointing out a simple syntax oversight, yes. The correct
syntax for that is select ... from (subselect) aliasname;
And that is required whether the alias is used or not. I at those times have
been tripped up by this r
sql.com
> Sent: Friday, 20 May, 2011 11:52:14 PM
> Subject: RE: Complex Query
>
> Select count(*) from (select) did not work. It says: "ERROR
> 1248 (42000): Every derived table must have its own alias" and I am
> not sure it really mean aliases.
>
I meant it may produce unexpected result.
Mimi
=> -Original Message-
=> From: Mimi Cafe [mailto:mimic...@googlemail.com]
=> Sent: 20 May 2011 22:52
=> To: 'Johan De Meersman'; 'Guido Schlenke'
=> Cc: mysql@lists.mysql.com
=> Subject: RE: Complex Que
duce expected result - especially after running a
query with MySQL limit clause.
Mimi
=> -Original Message-
=> From: Johan De Meersman [mailto:vegiv...@tuxera.be]
=> Sent: 20 May 2011 21:16
=> To: Guido Schlenke
=> Cc: mysql@lists.mysql.com
=> Subject: Re: Complex Query
=>
- Original Message -
> From: "Guido Schlenke"
> To: mysql@lists.mysql.com
> Sent: Friday, 20 May, 2011 9:04:32 PM
> Subject: Re: Complex Query
>
> Hi Mimi,
>
> try this
>
> select count(*) from
> (SELECT module_nr, IFNULL(image,'no_image
googlemail.com]
Sent: 20 May 2011 11:33
To: 'Anupam Karmarkar'
Cc: 'Guido Schlenke'; mysql@lists.mysql.com
Subject: RE: Complex Query
Hi guys
That's cool! It looks like my query was good except that I miss the "group
by". Now I only had to remove the "as image"
or_id =
pkauthor_id
WHERE module_nr = ? group by IFNULL(image,'no_image.jpg'),title,
subtitle, pkisbn, publisher;
Mimi
From: Mimi Cafe [mailto:mimic...@googlemail.com]
Sent: 20 May 2011 11:33
To: 'Anupam Karmarkar'
Cc: 'Guido Schlenke'; mysql@lists.mysql.co
May 2011 07:48
To: 'Guido Schlenke'; mysql@lists.mysql.com; Mimi Cafe
Subject: RE: Complex Query
Hi Guido,
You need to add group by in your query get desire result
SELECT IFNULL(image,'no_image.jpg') as image,title, subtitle,
group_concat(concat(fname,' ',initial,&
age,title, subtitle, pkisbn,
publisher
It should give desire result. As group concat will return group by 1 if you
dont specify group by, which will return only one row, to get result you need
to specify group by as given in above query.
--Anupam
--- On Fri, 20/5/11, Mimi Cafe wrote:
From:
Hi Guido
I like your powerful query below, but it doesn't answer my question. I guess
some clarification is needed here.
OK, I have books in the database with more than one author. When I query for
the title of books and name of author, I get more rows for books that have more
than one author.
ut error, but no relation can be seen when the
module is created in mysql workbench.
Thanks
Mimi
=> -Original Message-
=> From: George Pitcher [mailto:george.pitc...@publishingtechnology.com]
=> Sent: 19 May 2011 06:42
=> To: Mimi Cafe
=> Subject: RE: Complex Quer
=> -Original Message-
=> From: George Pitcher [mailto:george.pitc...@publishingtechnology.com]
=> Sent: 19 May 2011 06:42
=> To: Mimi Cafe
=> Subject: RE: Complex Query
=>
=> Mimi,
=>
=> I have a lot of biblio records across several applications. I decided
=> a
2011/05/18 22:22 +0100, Mimi Cafe
I am trying to retrieve record from 2 tables (book and author), but my
problem is how to retrieve all the names of authors where more than one
author wrote a book.
Here is what i have: it works OK, except that it returns more than one row
for books that
mysql workbench.
Thanks
Mimi
=> -Original Message-
=> From: George Pitcher [mailto:george.pitc...@publishingtechnology.com]
=> Sent: 19 May 2011 06:42
=> To: Mimi Cafe
=> Subject: RE: Complex Query
=>
=> Mimi,
=>
=> I have a lot of biblio records across se
Hint:
- group_concat
- group by
- having count(*)>1
Cheers
Claudio
2011/5/18 Mimi Cafe
> Hi
>
> I am trying to retrieve record from 2 tables (book and author), but my
> problem is how to retrieve all the names of authors where more than one
> author wrote a book.
>
> Here is what i
Brilliant, this one works perfect! Thank you for the quick reply!
Ben
Rolando Edwards wrote:
select distinct email_address
from people P,registered_products A,registered_products B
where P.person_id = A.person_id
and A.product_type = "Product A"
and P.person_id = B.person_id
and B.prod
Hi Benjamin,
Benjamin Ventura wrote:
I have a database tracking registrations of software products with two
related tables, "registered_products" and "people". I need to pull a
list of email addresses from the people table BUT I only want to pull
people records who own very specific combinati
select distinct email_address
from people P,registered_products A,registered_products B
where P.person_id = A.person_id
and A.product_type = "Product A"
and P.person_id = B.person_id
and B.product_type = "Product B"
;
Give it a try !!!
- Original Message -
From: "Benjamin Ventura"
ElkinFernando Ortiz wrote:
How i calculate for union the other 14
register in the same Query?
...
SELECT e.Plant,e.Date,e.Hour,e.Consuption From Energy Where
e.Plant=Var_Plant AND e.Date=Var_Date GROUP BY e.Plant,e.Date,e.H
By having an hours table (hour tinyint) which you join to your energy
"ElkinFernando Ortiz" <[EMAIL PROTECTED]> wrote on 03/10/2006 12:26:57
AM:
> I will explain my problem in spanish and english.
>
> Se deben Presentar los consumos por 24 horas de energia para su ingreso.
Si
> el usuario ha digitado 10 registros, se deben presentar estos mas los
otros
> 14 corr
> mysql Ver 12.22 Distrib 4.0.20, for mandrake-linux-gnu (i586)
With 4.1, it might have been a little easier using some subqueries.
But with 4.0, I don't think we can get the results you're looking for
in a single query, without some really nasty setup. Part of the issue
is that we need to join
of conditions (like where clausules)
James
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 12 August 2005 16:41
To: [EMAIL PROTECTED]
Cc: James M. Gonzalez; mysql@lists.mysql.com
Subject: Re: Complex query. (It's killing me)
Sorry - I think you need a
-Original Message-
From: James M. Gonzalez
Sent: 12 August 2005 16:58
To: 'Scott Noyes'
Subject: RE: Complex query. (It's killing me)
Sorry, I will explain myself more clearly:
Everyday, we ship packages, and we also receive some packages.
The one we receive, has bee
Sorry - I think you need a LEFT JOIN or it won't count shipments which are
not returned.
Alec
[EMAIL PROTECTED]
12/08/2005 16:38
To
[EMAIL PROTECTED]
cc
mysql@lists.mysql.com
Subject
Re: Complex query. (It's killing me)
Just in the spirit of refining my own skills, her
Just in the spirit of refining my own skills, here is how I would tackle
the problem. It parses, but I haven't populated the tables so I don't know
if it works:
SELECT s.dateshipped, COUNT(r.type="undelivered"), COUNT(r.type =
"customer"), COUNT(r.status="open")
FROM shipments s JOIN returns r
> Shipped Undelivered Returned Open
> 12/8/2005 143 3 3
Does this mean of the 14 shipped on 12/8/2005, 3 were returned at some
later date, or does it mean that you shipped 14 on 12/8/2005, and on
that same day 3 unrelated shipments came back, each of which co
index my_id (id);
-leo-
- Original Message -
From: Steffan A. Cline
To: Leo ; [EMAIL PROTECTED]
Sent: Monday, November 10, 2003 8:12 PM
Subject: Re: Complex query woes
Leo,
Thanks for the quick reply. There was a typo but I fixed it. Below is
what I used after
To: "Steffan A. Cline" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> Subject: Re: Complex query woes
>
> have you try left join?
>
> select
> mgr.company,
> building.bldgname,
> tenant.id
> from
> customers mgr
> left join customers building on buildin
have you try left join?
select
mgr.company,
building.bldgname,
tenant.id
from
customers mgr
left join customers building on building.pid=mgr.id
left join costumers tenant on tenant.pid=building.id
group by mgr.id, building.id, tenant.id
order by mgr.company, building.bldgname, tenant.company
hop
;awarsd" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, July 18, 2003 10:26 AM
Subject: RE: complex query qusetion
The optimal way for query speed would be to combine the most commonly
used categories. Because when you search the query categories, you will
find out that there is
The optimal way for query speed would be to combine the most commonly
used categories. Because when you search the query categories, you will
find out that there is a small set of combinations (say 10) which are
used 90% of the time.
Example: you have the categories A, B, C, D, E, F, G, H, I. Afte
corresponding number of invitations and a breaddown of inviations to show
total number of each invitation_status
- Original Message -
From: "Sammy Lau" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 30, 2002 6:01 AM
Subject: Re: Complex Query
>
try this:
select a.name, b.invitation_status, count(*) from stations a, invitations b
where a.id = b.station_id group by a.name, b.invitation_status
- Original Message -
From: "Ahmed Farouk" <[EMAIL PROTECTED]>
Date: Fri, 29 Nov 2002 22:50:34 +0200
To: <[EMAIL PROTECTED]>
Subject: Complex Q
You're producing a query of the form
SELECT x,y,z FROM table WHERE cat ="a,b,c" AND subcat="d,e,f";
Try: IMPLODE("\" OR \"",$category)
or maybe even IMPLODE('" OR "',$category) to remove all the escaping.
Doug
On Fri, 1 Mar 2002 16:14:17 -, John Lodge wrote:
>This is the sort of thing
This is the sort of thing I would do
$tmpquery = "SELECT item_pic, cat, sub, item_name, username FROM item_name
WHERE 1=1 AND";
if($category)
{
$filter1 = " cat =\"";
$filter1 .= implode("\",\"",$category);
$filter1 .= " \" ";
$tmpquery .= $filter1;
$tmpquery .= " AND ";
}
if($subcat)
{
$filter2
Carl Schrader wrote:
> Field Special 1 has a related field with a Start Date and another field
> for End date.
> Field Special 2 has a related field with a Start Date and another field
> for End date.
> Field Special 3 has a related field with a Start Date and another field
> for End date.
>
IMN
Hi,
So long as there is some way of joining your two tables, this shouldn't be a
problem:
SELECT name FROM mytable, myothertable WHERE (mytable.ID =
myothertable.idlistcolumn);
Regards
Quentin
-Original Message-
From: John Coggeshall [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 28 Febr
38 matches
Mail list logo