Heh. The parser is pointing out a simple syntax oversight, yes. The correct
syntax for that is select ... from (subselect) aliasname;
- Original Message -
> From: "Mimi Cafe"
> To: "Johan De Meersman" , "Guido Schlenke"
>
> Cc: mysql@lists.mysql.com
> Sent: Friday, 20 May, 2011 11:52:1
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 Query
=>
=> Select count(*) from (select..
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.
Although "select found_rows();" works, I am trying to avoid it as the
documentation says it may produce expected result - espe
Hmm. Simply replacing the field list with count(*) should work, too. If you
only need the count after having executed the select, I'm pretty sure there's
something in the API that gives you that without a second query, although I'll
be buggered if I can remember right now.
- Original Messag
- Original Message -
> From: "Reindl Harald"
>
> so put the wgole mysqld and its data on a server in the network
> for this mysql was built and not for borking the dadadir somewhere
> else
Hmm. The way I interpret what he's saying, is that he wants multiple instances
accessing the same
Hi Mimi,
try this
select count(*) from
(SELECT module_nr, IFNULL(image,'no_image.jpg'),title, subtitle,
group_concat(concat(fname,' ',initial,' ',lname)), pkisbn,
publisher,publication_year, edition, cover_type, pages FROM book INNER
JOIN publisher on pkpublisher_id = fkpublisher_id INNE
so put the wgole mysqld and its data on a server in the network
for this mysql was built and not for borking the dadadir somewhere else
Am 20.05.2011 15:58, schrieb Firdosh Dhooka:
> Thanks Johan.
>
> The reason to move database onto the network is that multiple user can
> access it. Do you think
Thanks Johan.
The reason to move database onto the network is that multiple user can
access it. Do you think there is a better alternative?
Firdosh
On Fri, May 20, 2011 at 9:45 AM, Johan De Meersman wrote:
>
>
> - Original Message -
>> From: "Reindl Harald"
>>
>> first: please post log
- Original Message -
> From: "Reindl Harald"
>
> first: please post log-outputs instead of "don't work"
>
> i guess: you changed only the path in my.cnf
> have you oved th existing datadir to the new location?
> if not the server will not start because it is missing
> the database "mys
Hi
I now need to determine the number of rows returned by this query below.
Wrapping it within SELECT COUNT did not work as expected.
SELECT module_nr, IFNULL(image,'no_image.jpg'),title, subtitle,
group_concat(concat(fname,' ',initial,' ',lname)), pkisbn,
publisher,publication_
Am 20.05.2011 15:05, schrieb Firdosh Dhooka:
> I wanted to install mysql community server and workbench on my machine.
> So I downloaded and installed it and everything seems working fine.
>
> But now I wanted to change the location of datadir from local to my
> network. So I stop the server fir
I wanted to install mysql community server and workbench on my machine.
So I downloaded and installed it and everything seems working fine.
But now I wanted to change the location of datadir from local to my
network. So I stop the server first using workbench and then change the
datadir under Opti
Aha, got the offender. Unlike all other ones, tables book_author was MyISAM
instead of Innodb.
Now everything works
alter table book_author add foreign key (fkauthor_id) references author
(pkauthor_id);
Query OK, 12 rows affected (0.39 sec)
Records: 12 Duplicates: 0 Warnings: 0
mys
WHat are the table engine types ?
On Fri, May 20, 2011 at 4:37 PM, Mimi Cafe wrote:
> Hi
>
> An ideas why MySQL silently ignores any foreign key constraints I define
> for
> the following tables?
>
>
> mysql> desc book;
>
> +--+---+--+-+---
Try
show create table ... ;
A
On Fri, May 20, 2011 at 12:07 PM, Mimi Cafe wrote:
> Hi
>
> An ideas why MySQL silently ignores any foreign key constraints I define
> for
> the following tables?
>
>
> mysql> desc book;
>
> +--+---+--+-+
Hi
An ideas why MySQL silently ignores any foreign key constraints I define for
the following tables?
mysql> desc book;
+--+---+--+-+-+-
--+
| Field| Type | Null | Key | Default |
Extra |
+
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" from the grouping below and it
works fine.
Thanks guys
Mimi
From: Anupam Karmarkar [mailto:sb_akarmar...@yahoo.com]
Sent: 20 May 2011 07:48
To: 'Guido Sc
I eventually came up with a solution myself although the query is a bit
different
SELECT C.file, C.digest, (a.cnt_A + b.cnt_B) AS total_count, C.refcount FROM C,
(SELECT file, digest, COUNT(file) AS cnt_A FROM A GROUP BY file, digest) as a,
(SELECT file, digest, COUNT(file) AS cnt_B FROM B GROUP
Hi Aveek,
You need to use something like union all and having to get desire result
Follow example below
select file, digest from
(
SELECT file, digest,Count(*) as Cnt FROM A GROUP BY file, digest
union all
SELECT file, digest,Count(*) as Cnt FROM B GROUP BY file, digest
) tmp
group by file,
19 matches
Mail list logo