MySQL dump by query

not mysqldump, but mysql cli… mysql -e “select * from myTable” -u myuser -pxxxxxxxxx mydatabase you can redirect it out to a file if you want : mysql -e “select * from myTable” -u myuser -pxxxxxxxx mydatabase > mydumpfile.txt Update: Original post asked if he could dump from the database by query. What he asked … Read more

How do I create a foreign key in SQL Server?

And if you just want to create the constraint on its own, you can use ALTER TABLE alter table MyTable add constraint MyTable_MyColumn_FK FOREIGN KEY ( MyColumn ) references MyOtherTable(PKColumn) I wouldn’t recommend the syntax mentioned by Sara Chipps for inline creation, just because I would rather name my own constraints.

PostgreSQL Crosstab Query

Install the additional module tablefunc once per database, which provides the function crosstab(). Since Postgres 9.1 you can use CREATE EXTENSION for that: CREATE EXTENSION IF NOT EXISTS tablefunc; Improved test case CREATE TABLE tbl ( section text , status text , ct integer — “count” is a reserved word in standard SQL ); INSERT … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)