Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

http://www.rbs.me.uk

« Newer Snippets
Older Snippets »
Showing 11-16 of 16 total

Output MySQL to a text file

// description of your code here

/opt/mysql/bin/mysql -u root -h mysql-server < q4.sql > ! out.txt

Start MySQL with LOAD LOCAL INFILE enabled

// description of your code here

/opt/mysql/bin/mysql -u root -h mysql-server --local-infile=1 

MySQL LOAD DATA LOCAL

// description of your code here

LOAD DATA LOCAL INFILE "/dc/elp/lionref/data/master/loggy.txt" INTO TABLE citations; 

Create Temporary MySQL Table

// description of your code here

USE reference;

CREATE TEMPORARY TABLE fulltxt
SELECT surname,atitle,title,type,journal,pqid,volume, issn,issue,spage,year
FROM citations
WHERE volume > 0
AND issue > 0
AND spage > 0
AND issn != ''
AND pqid != ''
; 

SELECT from multiple MySQL Tables

// description of your code here

SELECT fulltxt.pqid AS candidate_ft, citations.chid
FROM citations,fulltxt
WHERE citations.issn = fulltxt.issn
AND citations.volume = fulltxt.volume
AND citations.issue = fulltxt.issue
AND citations.year = fulltxt.year
AND citations.spage = fulltxt.spage
AND citations.pqid = ''
; 

query same table simultaneously with mysql

// description of your code here

USE reference;

SELECT c2.pqid AS candidate,c1.surname,c1.atitle,c1.title,c1.type,c1.journal,c1.pqid,c1.volume, c1.issn,c1.issue,c1.spage,c1.year
FROM citations AS c1, citations AS c2
WHERE c1.issn = c2.issn
AND c1.volume = c2.volume
AND c1.issue = c2.issue
AND c1.year = c2.year
AND c1.spage = c2.spage
AND c1.pqid != c2.pqid
AND c1.pqid = ''
; 
« Newer Snippets
Older Snippets »
Showing 11-16 of 16 total