Peter Brawley wrote:
>I want to find all A's such that
>they have exactly B's 1 and 2
>SELECT A.ID, group_concat(BID ORDER BY BID) as Bs
>FROM A INNER JOIN AhasB ON A.ID=AID
>GROUP BY A.ID
>HAVING Bs='1,2'
Why the join? Doesn't your ahasb bridge table already incorporate the
join logic? If your
Hello,
I'm having a conceptual issue with many-to-many relations. I have the
following structure:
Table A
ID (int primary key)
... descriptive columns ...
Table B
ID (int primary key)
... descriptive columns ...
Table AhasB
AID (references A.ID)
BID (references B.ID)
So,
I am writing an Apache module that has to perform some queries against a
MySQL database. For the most part, it is working properly. However, when I
get an empty result set for my query (that is, the select returns no rows) I
get a segmentation fault when trying to call mysql_num_rows.
Here is th
> systems
>
> sys_nameID
>
> Abrams 202
> Patriot 544
> Stinger 229
>
> ... and ...
>
> new_req
>
> proj_name ID
>
> Test Bed Alpha 3
> What I want to do is display to the user a list of files that
> require a
> security level that is less than or equal to the user's
> security level, with
> formatted last name and first name and date if the file is
> checked out.
>
> Checked out by is a foreign key refering to username in th
> mysql> SELECT cell, sector,
If you only want one row, then selecting cell doesn't make any sense.
Cell is different in each row you've selected. If you only want one
row, don't select cell.
> -> sum(att) as att,
> -> sum(lc) as lc,
> -> sum(csh) as csh,
> -> ROUND((SUM( lc + cs
> Whenever I insert data that is
> around 1 Megabyte in size, I get an error saying
> "MySQL server has gone away". It doesn't happen with
> smaller data, and even if I change the column type to
> LONGBLOB I still have this problem.
You've hit the default maximum packet size of 1 MB.
This is a pr
> Here's what I did. Based on the same query (the one you
> provided) as below
> I executed the following:
>
> select mgrname, pjname from managers, projects, pocs
> WHERE pjid = 'x'
> AND pocs.pjid = projects.pjid
> AND pocs.pmyid = 'x'
> AND pocs.altid = 'x'
> AND (pocs.pmyid = managers.pmyid
> Hello,
>
> I have a table with the following structure and values:
>
> CustomerIDScore
>
> 4 8
> 2 6
> 3 2
> 3 8
> 4 7
> 2 7
>
> I would like to query
> # Query_time: 17 Lock_time: 6 Rows_sent: 207550
> Rows_examined: 207550
> SELECT ID FROM sys_users;
If this is really the query that you want to do, there really isn't
much you can optimize. You're asking for every ID in the table,
so MySQL has to examine every row, and send every row.
You
10 matches
Mail list logo