* Micah Stevens [EMAIL PROTECTED]:
What kind of speed do you need?
I was aiming at something that would run in 2 hours or so. Currently, it
takes around 3 - 4.
I had to go to temp tables for a logging application, but not until my
table got upwards of a million records or so.. For the
Matthew Weier O'Phinney wrote:
I have a table which contains the following:
id (primary key, auto incrementing)
app_id (integer, foreign key)
resource_id (integer, foreign key)
word
score
(This is a search index.) I want to find all resource_ids from one app_id
that match
* Martin Norland [EMAIL PROTECTED]:
Matthew Weier O'Phinney wrote:
I have a table which contains the following:
id (primary key, auto incrementing)
app_id (integer, foreign key)
resource_id (integer, foreign key)
word
score
(This is a search index.) I want to
* Micah Stevens [EMAIL PROTECTED]:
Sounds like a self join should work wonders.
I didn't test this, but the idea should work:
select t1.app_id as a1, t2.app_id as a2, t2.word, t2.score
from tablename as t1
left join tablename as t2
on t1.resource_id = t2.resource_id and t1.app_id !=
What kind of speed do you need? I had to go to temp tables for a logging
application, but not until my table got upwards of a million records or so..
For the numbers your quoting, it should be pretty quick unless your engine
needs optimization..
On Friday 11 February 2005 11:56 am, Matthew
am using mysql 3 so i can't do that subquery, how can we do that in mysql 3 ?
On Mon, 7 Feb 2005 19:47:08 +, Simon Rees
[EMAIL PROTECTED] wrote:
On Monday 07 February 2005 18:22, Zouari Fourat wrote:
Hello
I have 2 tables with two columns in each one (cloned tables) like this :
ID
Zouari Fourat wrote:
am using mysql 3 so i can't do that subquery, how can we do that in mysql 3 ?
and neither can anyone else ;-)... rather a pain, but mysql.com have been
kind enough
to give a detailed explaination on how to rewrite subselect queries as join
queries:
If you put your brain in
that wont work :(
and either when changing RIGHT to LEFT JOIN that wont work
On Mon, 7 Feb 2005 13:41:01 -0500, Joseph Crawford [EMAIL PROTECTED] wrote:
try doing this
SELECT a.UserName FROM table1 a RIGHT OUTER JOIN table2 b ON
(a.UserName != b.username)
On Mon, 7 Feb 2005 19:22:15
:( nothing
On Mon, 7 Feb 2005 14:10:10 -0500, Joseph Crawford [EMAIL PROTECTED] wrote:
try INNER JOIN?
On Mon, 7 Feb 2005 19:47:29 +0100, Zouari Fourat [EMAIL PROTECTED] wrote:
that wont work :(
and either when changing RIGHT to LEFT JOIN that wont work
On Mon, 7 Feb 2005
On Monday 07 February 2005 18:22, Zouari Fourat wrote:
Hello
I have 2 tables with two columns in each one (cloned tables) like this :
ID int(6)
UserName varchar(25)
and i would like to select usernames from table1 that doesnt appear in
table2 so i did this :
Depending on which database
i asked this same question once and somehwere in the archives is a post by
John Holmes that shows an example of how mysql allows db joins. its from
last month i believe
http://marc.theaimsgroup.com/?l=php-db
but in short, mysql does support this using . db.table.field
hth
Jeff
Thanks, I found the post from John Holmes and was able to reconstruct the
query in mysql. But when I transferred that over to php and try to extract
an associative array from each record, I found that only one column came out
instead of two.
By simply changing the query from:
$query = select
You may be able to use mysql_fetch_array() and use numerical indexes to
reference the redundant names, but isn't it easier and better to just assign
aliases like you're doing?
It makes for more readable code, that's for sure.
-Micah
On Thu September 18 2003 12:55 pm, Mike Tallroth wrote:
to my knowledge this is not possible in MySQL. There are only joins at the
table level. I've been curious about this in the past myself, so if i'm
incorrect, i'm hoping to hear it via this post.
hth
jeff
From: Moshe Weitzman [EMAIL PROTECTED]
I have looked all over the web but can't find an example *in php* for
connecting to a mysql server, selecting database(s), and issueing a query
which joins across databases. I already know the SQL required to achieve a
multiple database query. My
From: [EMAIL PROTECTED]
to my knowledge this is not possible in MySQL. There are only joins at
the
table level. I've been curious about this in the past myself, so if i'm
incorrect, i'm hoping to hear it via this post.
You can stop hoping now. It is indeed possible. :)
mysql select * from
I assume something like the following would work, regardless of whether/how
you've called mysql_select_db()
SELECT t1.column FROM database1.table1 t1 JOIN database2.table2 t2 ON t1.id
= t2.id
If you have something working from the MySQL command line, then it's going
to work from mysql_query() with
At 16:09 06/01/2003 06/01/2003, Doug Parker wrote:
I have a relational database issue that I'll simplify for the sake of this
post. [...] So it would be like this:
id | company_id | status| company
1
At 04:09 PM 1/6/03 -0500, Doug Parker wrote:
I have a relational database issue that I'll simplify for the sake of this
post. I have one table, called clients, that has an id and the company
name. For example:
id | company
---
46 Jones Inc.
54 Baker Inc.
etc.
since you didnt list what type DB you are using, i assumed MYSQL. and MYSQL
doesnt have sub SELECTs... :(
http://www.mysql.com/doc/en/UPDATE.html
the syntax lists ...WHERE where_condition...
Michael Hendsbee wrote:
UPDATE Emails SET Sent = 'T' WHERE ID = (SELECT Emails.ID FROM Emails
Well, the first question is what's the expected output?
If you're trying to get, say, title from table1 and rating from table2
and identify the books in table1 by the unique field id and in table2
by the field book_id, then this is what you should have to end up with:
SELECT t1.title,
If you're looking to do cross-table joins, I'd advise a good book/class
on basic SQL or you're going to get in over your head very very quickly.
SELECT * FROM table1,table2;
This WILL run, but there's no where clause. Therefore it will return all
of table1 matched against all of table 2.
Ok thanks for that info, but I guess I am ignorant to what MS Access is.
Please enlighten me.
Thanks
Jennifer Downey
Marius Ursache [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED];
the best tool for building join queries is MS Access .
make a db same as that you use in mysql and
Microsoft Access: light-duty relational database with a world-class (in my
opinion) GUI interface, but I don't think it's going to help you in this
case.
id in image_data has the same value as id in wt_users
do you mean uid in wt_users? So, $id=session ID? I might set that ahead of
time just
Thank you Beau,
Appreciate that clarification.
Jen
Beau Lebens [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
what you are referring to actually has nothing to do with PHP Jen - that's
why the manual wasn't much help :)
JOIN is an SQL command, so check out
what you are referring to actually has nothing to do with PHP Jen - that's
why the manual wasn't much help :)
JOIN is an SQL command, so check out the manual of your RDBMS (ie.
http://www.mysql.com/doc/J/O/JOIN.html for MySQL)
good luck :)
Beau
// -Original Message-
// From: Jennifer
I would suggest changing COUNT(*) to COUNT(properties.PropertyID)
Regards
Jon
--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969 Mob 07763 620378
PGP Key available, send email with subject: Send PGP Key
- Original Message -
From: Martin E. Koss [EMAIL PROTECTED]
You use LEFT JOIN so your query is optimized. Probably your tables are big, you don't
have many MB of RAM. When you have big RAM, I
think that tables reside in memory and join of 5 tables every 600,000 rows is done
for 4-5s. May be you have to increase some of
the buffers sizes of mysql.
-
From: Daniel Barton [mailto:[EMAIL PROTECTED]]
Sent: 28 November 2001 4:14 PM
To: Martin E. Koss
Subject: Re: [PHP-DB] JOIN - Not working.
Try:
select sum(if(whatever=whatever,1,0)) as whatever from wherever where
whatever=whatever;
This is a pretty fast command for simple cross
There isn't the field table_name.ID_city!!!
because you didn't ask for it. You asked for:
table_name.name
table_city.ID
table_city.city
-Original Message-
From: Carlo Loiudice [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 09, 2001 4:02 PM
To: PHP DB
Subject: [PHP-DB] JOIN
select
n.name, c.city, c.ID
from
table_name n, table_city c
where
c.ID = n.ID_city
No sweat.
-Lorenzo
-Original Message-
From: Carlo Loiudice
Sent: Fri 11/9/2001 5:01 PM
To: PHP DB
Cc:
Subject: [PHP-DB] JOIN
http://www.atrivia.com
- Original Message -
From: Jorge Santos [EMAIL PROTECTED]
To: Gaby [EMAIL PROTECTED]
Cc: PHP-DB [EMAIL PROTECTED]
Sent: Friday, February 09, 2001 2:17 PM
Subject: Re: [PHP-DB] Join Sentences
Hi Gaby,
Your best bet is to probably place the statements you want
32 matches
Mail list logo