Computing desk | ||
---|---|---|
< August 16 | << Jul | August | Sep >> | August 18 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
This is from a practical problem but part of the motivation is trying to get better at SQL in general, which should frame any perceived XY problem. I.e. there are only a few hundred rows involved so I could easily write a script that does it row by row, but I'm trying to figure out if it's possible to write a sane SQL update that does the following.
I have a table OLD with columns NAME and ADDRESS, and some of the people in it have moved, so I have another table NEW which also has NAME and ADDRESS (giving the new addresses of the people who have moved). Most of the people in OLD have not moved, so they don't have entries in NEW. I want to update OLD to replace the addresses of people who have moved with their new addresses. This is wrong SQL but is conceptually something like what I'm looking for:
UPDATE old SET address = new.address FROM old JOIN new ON old.name = new.name;
Any suggestions? Thanks. 173.228.123.207 (talk) 01:42, 17 August 2019 (UTC)
UPDATE old JOIN new ON old.name = new.name SET old.address = new.address;
UPDATE old SET address = (SELECT address FROM new WHERE name = old.name)
WHERE EXISTS (SELECT address FROM new WHERE name = old.name);
Hi, guys! At https://www.webcitation.org/6XfufE6Jb?url=http://ci.nii.ac.jp/els/110000469807.pdf?id%3DART0000851255%26type%3Dpdf%26lang%3Den%26host%3Dcinii%26order_no%3D%26ppv_type%3D0%26lang_sw%3D%26no%3D1428634639%26cp%3D there is a PDF file that I want to make a second archive of, on http://megalodon.jp
However the archive seems to only show a blank page https://megalodon.jp/2019-0818-0337-28/https://www.webcitation.org:443/6XfufE6Jb ... I'd like a find a way to archive the actual PDF. However I need the actual URL of the PDF itself, and:
How do I get the exact URL of the embedded PDF file? Thanks, WhisperToMe (talk) 18:41, 17 August 2019 (UTC)
It looks messy, i.e. the server is sending the pdf to mainframe.php based on a cookie set in the outer page or something like that. Simplest might be to set up your browser preferences for application/pdf to save the pdf to disk instead of previewing it. Then re-upload it to wherever you want your 2nd archive to be. The file is about 1.4MB so the download/upload is not too bad. 67.164.113.165 (talk) 08:21, 18 August 2019 (UTC)
If you're really determined you can usually figure out a way to do scripted downloads from those sites, but if it's just for one file it's not worth the trouble. I had no trouble manually downloading the pdf using a browser. After that it's just a matter of re-uploading it to wherever. 67.164.113.165 (talk) 22:50, 21 August 2019 (UTC)