INSERT INTO tbl (SELECT) UNION (SELECT) ORDER BY field-does not work. Why?

2003-12-02 Thread George Georgeus
Hi! I do not know how to use INSERT and UNION together. For example: INSERT INTO tmp_table_name (a) (SELECT a FROM table_name WHERE a=10 AND B=1 ORDER BY a LIMIT 10) UNION (SELECT a FROM table_name WHERE a=11 AND B=2 ORDER BY a LIMIT 10) ORDER BY a; It does not work. But I think it should. Have

RE: INSERT INTO tbl (SELECT) UNION (SELECT) ORDER BY field-does not work. Why?

2003-12-02 Thread Wouter van Vliet
George Georgeus wrote: Hi! I do not know how to use INSERT and UNION together. For example: INSERT INTO tmp_table_name (a) (SELECT a FROM table_name WHERE a=10 AND B=1 ORDER BY a LIMIT 10) UNION (SELECT a FROM table_name WHERE a=11 AND B=2 ORDER BY a LIMIT 10) ORDER BY a; It does not work

Re: INSERT INTO tbl (SELECT) UNION (SELECT) ORDER BY field-does not work. Why?

2003-12-02 Thread Sergei Golubchik
Hi! On Dec 02, George Georgeus wrote: Hi! I do not know how to use INSERT and UNION together. For example: INSERT INTO tmp_table_name (a) (SELECT a FROM table_name WHERE a=10 AND B=1 ORDER BY a LIMIT 10) UNION (SELECT a FROM table_name WHERE a=11 AND B=2 ORDER BY a LIMIT 10) ORDER

select count(*) / select count(column) in innodb

2003-11-06 Thread Hsiu-Hui Tseng
Hi, select count(*) is very slow in innodb (because it is a table scan). Is there any difference if I change it to select count(column). I did some test and some times select count(*) is really slow and some time select count(column) is slow. Could anyone help me? If I need do a select

RE: select count(*) / select count(column) in innodb

2003-11-06 Thread Dathan Vance Pattishall
- Dathan Vance Pattishall   - Sr. Programmer and mySQL DBA for FriendFinder Inc.   - http://friendfinder.com/go/p40688 ---Original Message- --From: Hsiu-Hui Tseng [mailto:[EMAIL PROTECTED] --Sent: Thursday, November 06, 2003 3:41 PM --To: [EMAIL PROTECTED] --Subject: select count

Re: select count(*) / select count(column) in innodb

2003-11-06 Thread Paul DuBois
At 15:41 -0800 11/6/03, Hsiu-Hui Tseng wrote: Hi, select count(*) is very slow in innodb (because it is a table scan). Is there any difference if I change it to select count(column). I did some test and some times select count(*) is really slow and some time select count(column) is slow. Could

SELECT....UNION SELECT.....

2002-11-12 Thread Prabu Subroto
Hallo my friends I am writing a database application program with PHP and MySQL. I have two tables that I want to query in the same time with SELECT...UNION SELECT ... syntax. Too many errors encountered; the rest of the message is ignored: The 2 tables are APPOINTMENT table (APP

Re: SELECT....UNION SELECT.....

2002-11-12 Thread Rafal Jank
to this message, and include the entire text of it in the reply, your reply will go through. However, you should first review the text of the message to make sure it has something to do with MySQL. Just typing the word MySQL once will be sufficient, for example. You have written the following: SELECT

select in select

2002-05-21 Thread van den Heuvel, Frank
Hello, I would like to do this witihn mysql: SELECT con.id,con.name FROM contacts con, registrar_contact reg WHERE NOT con.id IN (SELECT contactid FROM registrar_contact WHERE registrarid=1) can someone tell me how to do this ? contacts table consists of: id(primary key) name

select in select

2002-05-21 Thread van den Heuvel, Frank
Hello, I would like to do this witihn mysql: SELECT con.id,con.name FROM contacts con, registrar_contact reg WHERE NOT con.id IN (SELECT contactid FROM registrar_contact WHERE registrarid=1) can someone tell me how to do this ? contacts table consists of: id(primary key) name

RE: select in select

2002-05-21 Thread Jay Blanchard
[snip] SELECT con.id,con.name FROM contacts con, registrar_contact reg WHERE NOT con.id IN (SELECT contactid FROM registrar_contact WHERE registrarid=1) [/snip] Current versions of MySQL do not support sub-selects. HTH! Jay

RE: select in select

2002-05-21 Thread Gurhan Ozen
You can use JOIN... See: http://www.mysql.com/doc/A/N/ANSI_diff_Sub-selects.html Gurhan -Original Message- From: van den Heuvel, Frank [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 8:47 AM To: '[EMAIL PROTECTED]' Subject: select in select Hello, I would like to do

URGENT: select in (select) or Join?

2001-04-12 Thread Sofiane Sakhri
Hello, Please, I use MySql, I would use INTERSECT/UNION functions and they don't work, I need help, My query is : select E.*, ME.Emplacement, E.Url,E.EMail, C.Name From Entreprise E, Mot_Entreprise ME, Mot M, Categorie C where (E.ID=ME.ID) and (ME.CodeMot=M.CodeMot) and (M.Mot like 'word1

select within select

2001-03-08 Thread Lance Koh
hi, i was wondering if the above is possible in mysql. i was working on a query but it keep throwing me syntax error. example: sql select * from table1 where id in (select id from table1 group by id having count(id) 1) the above statement works perfectly in mssql... thanks regards, lance

newbie: problem with select in (select)

2001-02-05 Thread Henrik Lebtien Mohr
Hi again If I try the following on my MySQL DB, I get an error: select user_id from tblUser where user_id in (select user_id from tblUserLink where group_id = xx) xx is an integer defining which group_id we want info on (mediumint(9)) user_id in tblUser and tblUserLink is also defined

Re: newbie: problem with select in (select)

2001-02-05 Thread René Tegel
ect: newbie: problem with "select in (select)" Hi again If I try the following on my MySQL DB, I get an error: select user_id from tblUser where user_id in (select user_id from tblUserLink where group_id = xx) xx is an integer defining which group_id we want info on (mediumint(9)) user