Bernd,
BM> I want to get the difference between 2 tables.
BM> table_1:
BM> column_1
BM> A
BM> B
BM> C
BM> D
BM> table_2:
BM> column_2
BM> B
BM> C
BM> What is the sql select syntax to get as result A,D or B,C?
Look at JOIN clause:
http://www.mysql.com/doc/J/O/JOIN.html
For example:
SELECT * FROM table_1 LEFT JOIN table_2 ON
table_1.column_1=table_2
Hi all,
I want to get the difference between 2 tables.
table_1:
column_1
A
B
C
D
table_2:
column_2
B
C
What is the sql select syntax to get as result A,D or B,C?
Thanx for your help.
Regards,
Bernd
Hi all,
trying to figure out if there is a query I can use for this, or if I
have to write a php script to loop tru each row...
table1:
entryid int(11)
itemid int(11)
table2:
object_id int(11)
....
The situation is: table2.objectid is populated with the values of
table1.itemid, but they have to be replaced with the corresponding
table1.entryid.
I could do in PHP:
- select * from
Hi Mysql fans ;-),
I just came across this in the manual
http://www.mysql.com/doc/en/CREATE_TABLE.html
where it show as table types MERGE and MRG_MYISAM tables.
Than I continued onto this page
http://localhost/xoops/manuals/mysql/en/MERGE.html
Where it says "You can only use identical MyISAM tables for a MERGE table."
I understood that MERGE tables can exist only of MyISAM tables
Hello,
I am trying to set up mysql replication between 4 machines each with version
3.23.38 installed. My problem is that the master database has a table called
metadata and the slaves have the same table but called METADATA. Is there a
replicate-rewrite-table option, or do I need to trap the selects on metadata
and convert them to lowercase in the code to get the replication to work
?...
Hello All,
I recently moved my database from mysql 3.22.29 to 3.23.41, and udated all my
tables to MyISAM tables. Under ISAM, I could take the filesize of the ISD
table and divide by the record length to get the exact number of records
returned by "select count(*)" from that table (or vise-versa - it always
worked).
Now with the MyISAM tables, this does not seem to work - the files are
Hi,
I apprecaite anybody replying me with an equvalent query for this:
I am using mysql 4.0.21
select a.address from a where a.id not in (select b.iid from b where
b.message='y')
- Harish
I apparently am misunderstanding how the select works by referencing data in
two different tables. I have used a similar statement to the one that
follows with success, but there must be something different here that
reveals a lack of fundamental understanding as to how it works. If someone
could help, please check the following...
I have two tables. One table has entries
controlnum,referencenum
I want to write an efficient query that will delete all records from one
table when they show up in another table (pending shipments --> shipped
shipments). I can't do it with this:
mysql> DELETE from pending_2 WHERE pending_2.ordno = ordersearch_2.ordno;
because you can only refer to columns of one table in a delete query. Does
anybody have an effiecnt way for me to do this with Perl
im having problems getting results querying two tables but I am not sure of
the correct php syntax for the query statement below. It always yields 0
results.
$query2 = "select * from dir,free where 'dir.inst' = free.inst'";
This is what I use in mySQL database but I get 0 results when querying from
php.
SELECT*
FROM dir,free
WHERE dir.inst = free.inst
Any help would be greatly appreciated