ÇóSQL²éѯ·½·¨
ÇóSQL²éѯ·½·¨£º Òª´ÓACCESSÊý¾Ý¿âÖвéѯÈý¸ö×Ö¶Î"ÐÕÃû""Éí¸ß""ÌåÖØ"£¬VB´°ÌåÉÏÓÐËĸöÎı¾¿òheightmin,heightmax,weightmin,weightmax£¬·Ö±ðÊäÈëÉí¸ßºÍÌåÖØµÄ×î´óÖµºÍ×îСֵ£¬¸ù¾ÝÊäÈëµÄÉí¸ß·¶Î§ºÍÌåÖØ·¶Î§²éѯ³öÂú×ãÌõ¼þµÄ¼Ç¼µÄÐÕÃû¡¢Éí¸ßºÍÌåÖØ£¬ÇëÎÊÕâ¸ö²éѯÓï¾äÔõôд£¬ÔõÑù°ÑÎı¾¿òÖеÄÖµ¸³¸ø²éѯÓï¾ä£¨Ö±½ÓдÉí¸ßbetween heightmin.text and heightmax.textÊDz»Ðеģ©
dim sql as string sql = "select * from xxx where ÌåÖØ between " & heightmin.text & " and " & heightmax.text sql=" select * from ±íÃû where Éí¸ß between "& heightmin.text &" and "& heightmax.text &"" http://topic.csdn.net/u/20091118/21/6d3d3696-ee6c-4d73-9591-7a8d2543d4d3.html dim sCmd as string sCmd="Select * from ÄãµÄ±í Where Éí¸ß between '" & heightmin.text & "' and '" & heightmax.text&"' and/or ÌåÖØ between '" & weightmin.text & "' and '" & weightmax.text&"' " ÊÔÏ¿ÉÒÔ²»£¿ ÒýÓà dim sCmd as string sCmd="Select * from ÄãµÄ±í Where Éí¸ß between '" & heightmin.text & "' and '" & heightmax.text&"' and/or ÌåÖØ between '" & weightmin.text & "' and '" & weightma
Ïà¹ØÎÊ´ð£º
±íÈçÏ ½ÌÊÒID ×ùλÊý ¿ªÊ¼Ê±¼ä ½áÊøÊ±¼ä 2009Äê1ÔÂ1ÈÕ 2009Äê1ÔÂ2ÈÕ 2009Äê1ÔÂ3ÈÕ 101 50 08£º00 08£º30 30 40 50 101 50 09£º00 ......
ÎÒµÄTblworkbill±íµÄÊý¾ÝÈçÏÂ: id workbillno .................. 1 1 2 6 3 a1 4 c2 5 2 6 aa 7 ......
sql 2005Êý¾Ý¿âÎÒÏëµÃµ½Ò»×Ö·û´®Îª: sldkf|||sdeww erkv|||rltdk jemcl|||ligf ¾ÍÊÇ|||ºóÃæµÄ×Ö·ûÓÐʲôº¯ÊýÄܵõ½Âð£¿ÊÇÔÚsqlÓï¾äдµÄ£¬²»ÊÇÔÚÒ³ÃæÐ´µÄ£¬ÄÇλ¸ßÊÖÀ´Ö¸½ÌÏ£¬ÐÂÊÖ£¬Ð»Ð» ÔÎ µ ......
ÎÒÓÐÒ»¸ö±í£¬½á¹¹ÊÇÕâÑù¡£ ת³ö µ¥Î» תÈ뵥λ ±ÊÊý ½ð¶î date(Ö÷) outid(Ö÷) inid(Ö÷) num amt 2009 1 2 1 500 Ϊ 1 µ¥Î» ÔÚ2009Ä ......
--drop table #T1 --drop table #T2 create Table #T1(ID int, QueryID nvarchar(20), ResultID1 nvarchar(20), ResultID2 nvarchar(20)) create Table #T2(SortNo int, QueryID nvarchar(20), ResultID1 nv ......