create table users (userid int(10) unsigned, primary key (userid), name text);
grant all on mydatabase.* to myuser@localhost;grant all on *.* to myuser@localhost;grant all on *.* to myuser@localhost with grant option;grant all on *.* to myuser@localhost identified by 'prettysecret' with grant option;set password for myuser@localhost = password('prettysecret');
select name as myname from namestable where (select count(*) from persondetails where name = myname) = 0;
alter table mytable add column mycolumn text
or:
alter table mytable add column mycolumn int unsigned not null auto_increment
...etc
select groupname, groupnum, (select count(*) from group_members where groupid = groupnum and person = '456') as nummembers from groups
Say you have many entries, and some of them may be duplicates, based on their titles:
select * from (select title, count(title) as howmany from mytable group by title order by title) as innerquery where howmany > 1;
alter table mytable drop primary key;
alter table mytable change column newid newid int(10) primary key; (or your own definition).
insert into newtable select mycol, myothercol, mythirdcol from oldtable where ... ;