Dynamic table in MySQL

MYSQL 테이블을 가변적으로 사용할때 쓰면 편리하다

SET
@table = 'mysql.user';
SET @host = '''%localhost%''';
SET @s = CONCAT('SELECT * FROM ', @table, ' WHERE host LIKE ', @host);
PREPARE stmt FROM @s;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;

음..

Posted by 웅쓰

2010/01/05 11:53 2010/01/05 11:53
Response
No Trackback , No Comment
RSS :
http://comefeel.com/tt/comefeel/rss/response/420

Trackback URL : http://comefeel.com/tt/comefeel/trackback/420

« Previous : 1 : ... 11 : 12 : 13 : 14 : 15 : 16 : 17 : 18 : 19 : ... 357 : Next »

블로그 이미지

웅자의 상상플러스

- 웅쓰

Archives

Authors

  1. 웅쓰

Recent Trackbacks

Calendar

«   2012/02   »
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29      

Site Stats

Total hits:
289290
Today:
20
Yesterday:
353