Loading
2014. 3. 28. 13:30 - citybell.com

SQL MySQL script : SELECT 예제

CREATE TABLE  user
(
   name     char(16)  NOT NULL ,
   age        integer,
   email      vchar(100),
   userid     char(16) NOT NULL , 
   passwd   char(16)  
) 


SELECT  *  FROM  user  WHERE  age > 30 ;    

SELECT  name, age  FROM  user  WHERE  age > 30 ; 
 
SELECT  *  FROM  user  WHERE  age > 19 AND age < 40 ;   

SELECT  *  FROM  user  ORDER BY  age  ASC ;            DESC (내림차순)

SELECT  *  FROM   address WHERE  name LIKE "강*“ ;

SELECT  *  FROM   address WHERE  addr   LIKE “*삼성*“ ;


관련된 글: INSERT, UPDATE, DELETE 예제
관련된 글: CREATE, DROP 예제
관련된 글: Replace 예제

 

 

  • Total 5,241,232
  • Today 19
  • Yesterday 149
  • Total 5,241,232
  • Today 19
  • Yesterday 149

댓글을 입력하세요