Re: How to write subqueries?

2005-06-15 Thread admin
Hello! > another simpler solution : > ... Thanks, Mathias! You helped me greatly! Now my program works as desired. -- Good luck! Vladimir Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html -- MySQL General Mailing List For list

Re: How to write subqueries?

2005-06-14 Thread mfatene
You're welcome. if you have more than one pnid, you should use perl or php. then use a loop to manage each pnid query, then send it to the server, and use it's result. another simpler solution : mysql> create table sql as select concat('vt_',pnid) tbl from vt_parition where pnid regexp ('^[0-9]{

Re: How to write subqueries?

2005-06-14 Thread admin
Hello! Many thanks to everybody who tried to help me! > N.B. you should have only one pnid to make your query work (UNIQUE pnid), > or LIMIT the result of the subquery by LIMIT 1. I need to do the following: Get one or more than one "pnid" from vt_partition and then make queries to the "vt_pni

Re: How to write subqueries?

2005-06-14 Thread mfatene
Hello, You forgot a parenthesis in the regexp function. Second, if you construct your query with prepared statements, you can do it : mysql> insert into vt_partition(pnid) values('01234567890'); mysql> select concat('vt_',pnid) into @tbl from vt_parition where pnid regexp ('^[0-9]{11}$') ; mysql>

RE: How to write subqueries?

2005-06-14 Thread Rhino
To: admin Cc: mysql@lists.mysql.com Subject: Re: How to write subqueries? admin <[EMAIL PROTECTED]> wrote on 06/14/2005 01:01:33 PM: > Hello! > MySQL v. 4.1.11. > I'm trying to write a subquery, MySQL says "Error". > select num, theme, intro > from vt_(se

RE: How to write subqueries?

2005-06-14 Thread Rhino
Have you looked at this page of the manual? http://dev.mysql.com/doc/mysql/en/string-comparison-functions.html It describes several ways to do the sort of searches you want to do and there are several examples. You might find that LIKE or STRCMP() work better than REGEXP for your requirements.

Re: How to write subqueries?

2005-06-14 Thread SGreen
admin <[EMAIL PROTECTED]> wrote on 06/14/2005 01:01:33 PM: > Hello! > MySQL v. 4.1.11. > I'm trying to write a subquery, MySQL says "Error". > select num, theme, intro > from vt_(select pnid from vt_partition where pnid regexp '^[0-9]{11}$') > order by date desc, timer desc; > describe vt_parit