Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

sql¶à±íÁªºÏ²éѯµÄÎÊÌâ

ÏÖÔÚÓöµ½Á˸öÊý¾Ý¿â²éÕÒµÄÎÊÌ⣬Á¬½Ó²éÕÒ£¬ÏÖÔÚÓÐÈý¸ö±íusers ±í£¬sex±í£¬languages±í£¬sex±íÖеÄlang_id ºÍmotherlang_idÊÇÖ÷¼üÍâ¼ü¹Øϵ
ͼƬ£º
ÁªºÏ²éÕÒÐÅϢʱ
Èç¹ûÐÅÏ¢ÍêÕûµÄ»°ÊÇ¿ÉÒÔ²éÕÒ³öÀ´µÄ£¬µ«ÊÇÐÅÏ¢²»ÍêÕûµÄ»°¾Í²îÕÒ²»³öÀ´¡££¨Èç Óû§tanaka¾ÍÎÞ·¨²é³öÐÅÏ¢£©²éÕÒÓï¾äÈçÏ£º
select users.id,username,sex_name,age,motherlang.language_name,lang1.language_name,lang2.language_name
from users,sex,language motherlang,language lang1,language lang2
where username='Jessica' and sex_id=sex.id and motherlang_id=sex.lang_id and motherlang.id=motherlang_id and lang1.id=lang1_id and lang2.id=lang2_id
ËäȻ֪µÀÊÇÓÃÍâÁ¬½Ó²éÕÒ£¬µ«ÊÇÎÒÖ»»áÁ½¸ö±íÖ®¼äµÄÍâÁ¬½Ó²éÕÒ£¬ËùÒÔ¶à±íÖ®¼ä£¬Ó¦¸ÃÔõô¸Ä²Å¿ÉÒÔ²éÕÒ³öÐÅÏ¢À´ÄØ£¿


Ïà¹ØÎĵµ£º

SQL ×¢Èë




SQL×¢Èë¾Í²»ÓýéÉÜÁË£¬ÍøÉϺܶࡣÏÂÃæ½éÉÜһϷÀÖ¹
SQL×¢ÈëµÄ·½·¨¡£
ʹÓÃ
quotename º¯ÊýºÍ
sp_executesql
²Î¿¼Èç
ϱí½á¹¹£ºÕâÊÇÒ»¸öÎĵµ±íÀïÃæÓÐһЩ¼òµ¥µÄ×Ö¶ÎÐÅÏ¢
CREATE
TABLE
[dbo]
.
[DocumentInfo]
(
    [ID]
[int]
IDENTITY
(
1,
1) primary key
 NOT
......

¾­µäSQLÓï¾ä´óÈ«

Ò»¡¢»ù´¡
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CREATE DATABASE database-name
2¡¢ËµÃ÷£ºÉ¾³ýÊý¾Ý¿â
drop database dbname
3¡¢ËµÃ÷£º±¸·Ýsql server
--- ´´½¨ ±¸·ÝÊý¾ÝµÄ device
USE master
EXEC sp_addumpdevice 'disk', 'testBack', 'c:\mssql7backup\MyNwind_1.dat'
--- ¿ªÊ¼ ±¸·Ý
BACKUP DATABASE pubs TO testBack
4¡¢Ë ......

¹ØÓÚDB2 sql:0206n ´íÎó

½ñÌìÅöµ½Ò»¸ösql:0206nµÄ´íÎó£¬ÎÒʹÓÃselect * from xxx¿ÉÒԲ鿴±í½á¹¹ºÍÄÚÈÝ£¬È»¶øµ±ÎÒʹÓÃselect aaa from xxxµÄʱºòÈ´¸øÎÒ±¨´í£¬×îºóÅŲéÔ­ÒòÊÇÎÒʹÓù¤¾ß½¨±í£¬½¨±íÓï¾äÊÇÀàËÆÕâÑùµÄ£ºcreate table("id" int,"name" varchar)£¬ºÃÁ˽á¹û¾ÍÊÇ×ֶθø¼ÓÁËÒýºÅ£¬ÔÚ²éѯµÄʱºòʹÓÃ*¿ÉÒÔ²éѯ£¬Ê¹Óõ¥¸ö×ֶβ»Äܲéѯ£¬ÎÒ¹À¼Æ¾ÍÊ ......

SQL ³£ÓÃµÄ Ôö¡¢É¾¡¢¸Ä¡¢²é »¹ÊÇÀμÇÓÚÐÄ àÞ

¼¸¸ö¼òµ¥µÄ»ù±¾µÄsqlÓï¾ä
 
Ñ¡Ôñ£ºselect * from table1 where ·¶Î§
²åÈ룺insert into table1(field1,field2) values(value1,value2)
ɾ³ý£ºdelete from table1 where ·¶Î§
¸üУºupdate table1 set field1=value1 where ·¶Î§
²éÕÒ£ºselect * from table1 where field1 like ’%value1%’
ÅÅÐò£ ......

¼Ç¼¼¸Ìõ¸Ð¾õ²»´íµÄsqlÓï¾ä

SELECT id,ip,from_unixtime(last_task_request_time) t1, from_unixtime(last_task_finish_time) t2
from yq_nodemanage
WHERE node_type=1
ORDER BY t1 DESC;
SELECT sum(unix_timestamp(gather_time)-unix_timestamp(publish_time))/(count(*)*60) from yq_bbs_docinfo
WHERE unix_timestamp(publish_time)>un ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ