AddThis

Share |

Thursday, July 15, 2010

MySQL Query

SET FOREIGN_KEY_CHECKS=0;

DELETE FROM address WHERE USER_ID IN(41,42,43,44,45,46,47,48,49,50);
DELETE FROM users WHERE USER_ID IN(41,42,43,44,45,46,47,48,49,50);

SET FOREIGN_KEY_CHECKS=1;

SELECT * FROM static_page_name WHERE StaticPageTypeID=11 AND StaticPageID IN(41,42,43,44,45,46,47,48,49,50);

SET FOREIGN_KEY_CHECKS=0;

DELETE FROM address WHERE USER_ID=9;
DELETE FROM affiliate WHERE UserID=9;


SET FOREIGN_KEY_CHECKS=1;

SELECT * FROM static_page_name WHERE StaticPageTypeID=11 AND StaticPageID=9;

SELECT CONCAT(' DELETE FROM ', TABLE_NAME, ' WHERE UserID=1;')
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = 'currentmanpower';

SELECT count( 'x' )
FROM information_schema.COLUMNS AS MODON
WHERE MODON.TABLE_SCHEMA = 'currentmanpower'
AND MODON.COLUMN_NAME
IN (
'USER_ID', 'UserID', 'OWNER_ID', 'OwnerID'
);

0 comments:

Post a Comment