mysql Ìæ´ú×Ó²éѯ
//in×Ó²éѯµÄд·¨ ÎÒ×Ô¼ºµÄmysqlÖ§³Ö ·þÎñÆ÷²»Ö§³Ö
(select user_no,videofile from user_info where phone in(SELECT caller from pair_info where receiver='1365555' and invite_flag=1 and read_flag=0 ) and phone not in(SELECT receiver from pair_info where caller='1365555'and receive_invite_flag=2 and createtime>=now()) and status=1 and top_flag=1 and valid_top_datetime>now() order by lastupdatetime desc) union (select user_no,videofile from user_info where phone in(SELECT caller from pair_info where receiver='1365555' and invite_flag=1 and read_flag=0 ) and phone not in(SELECT receiver from pair_info where caller='1365555' and receive_invite_flag=2 and createtime>=now()) and status=1 and top_flag=0 order by lastupdatetime desc)
//²»Ö§³Öin ¿´¿´ anyÐв»,»¹ÊDz»ÐÐ
(select user_no,videofile from user_info where phone = any (SELECT caller from pair_info where receiver='1365555' and invite_flag=1 and read_flag=0 ) and phone != any (SELECT receiver from pair_info where caller='1365555' and receive_invite_flag=2 and createtime>=now()) and status=1 and top_flag=1 and valid_top_datetime>now() order by lastupdatetime desc) union (select user_no,videofile from user_info where phone = any(SELECT caller from pair_info where receiver='1365555' and invite_flag=1 and read_flag=0 ) and phone != any(SELECT receiver from pair_info where caller='1365555' and receive_invite_flag=2
Ïà¹ØÎÊ´ð£º
ÎÒÊÇÓÃmysql×Ô´øµÄC API
if(mysql_real_connect(&mysql,"125.0.0.108","root","root","home",3306,NULL,0))
{
AfxMessageBox("Êý¾Ý¿âÁ¬½Óʧ°Ü") ......
ÎÒ¶ÔSQL SERVERºÍACCESS±È½ÏÊ죬ËùÒÔÊý¾Ý¿âµÄͨÓûù´¡¶«Î÷¿ÉÒÔ˵¶¼ÕÆÎյIJ¶àÁË£¬ÎÒÏÖÔÚÏëÒªµÄ¾ÍÊÇÒÔÉÏÁ½Êý¾Ý¿âµÄ¶ÀÌØÖ®´¦µÄ½éÉܺÍÓ¦ÓýéÉÜ¡£
ÁíÍâÊé×îºÃ¶ÔÓ¦×îа汾 oracleÊÇ11g°É 10µÄÒ²ÐУ»mysqlÊÇ5.1°É
л ......
ÈçÌ⣬MySQL²»»áÕâÑù°É
Ö§³Ö£¬Ä㽨Á¢Êý¾Ý¿âµÄʱºòÖ¸¶¨×Ö·û¼¯utf8»òÕßgbk¾ÍÐÐÁË¡£
http://blog.csdn.net/ACMAIN_CHM/archive/2009/05/12/4174186.aspx
MySQL ÖÐÎÄÏÔʾÂÒÂë
Ö§³Ö£¬¼ì²é×Ö·û¼¯ÉèÖÃ
Ö§³Ö£¬¼ì² ......
Çë¸ßÊÖÖ¸µã,ÎÒ¶ÔÒ»Õűí²éѯºóÔÙ¸üÐÂ,²éѯÊÇ×Ó²éѯ,±¨´í:
You can't specify target table 'a_table' for update in from clause
ÍêÕûSQLÓï¾äÊÇ
UPDATE a_table SET STATUS=0 WHERE ID=(SELECT MIN(ID) from a_tab ......