john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

Mysql non interactive truncate variables

mysql -Nse 'select * from users;' MYDATABASE    # mysql -uroot -e "SELECT * FROM users;" MYDATABASE

mysql -Nse 'show tables' MYDATABASE | while read table; do mysql -e "truncate table $table" MYDATABASE; done

select eft.* from ExampleFeatureTable, ExampleOtherTable eot where eot.accountID='1234' AND eft.featureName = 'Button';

insert into targetdatabase.TargetTable ( accountID , FirstName , LastName ) select 'def-<accountID>', (select Name from NameTable where Name = 'John'), 'Smith';

  • « getattr object method from string
  • twisted errback exceptions »

Published

Sep 4, 2013

Category

sql

~56 words

Tags

  • interactive 4
  • mysql 18
  • non 5
  • sql 18
  • truncate 2
  • variables 5