Help talk:MySQL queries

From Wikitech
Jump to navigation Jump to search

Annoying that this page had been forked while the original one was still being worked on. I'm merging the updates which happened on the source... --Nemo 14:08, 20 July 2015 (UTC)


Shared Repository

I've added all the queries here to /shared/sqlqueries on Tool Labs. I'll try to watch this page and keep them updated, but everyone has write access, so any help is appreciated. There's a helper script in there, makefile.sh, that allows you to copy/paste the headers on this page and then opens nano so you can copy/paste the SQL query in, save and exit. Also, a big thank you to those converting the queries over to Tool Labs! #avicennasis@wikitech 06:20, 29 July 2015 (UTC)

Can Any One Help me with MySQL

Hi, I Need Help With Code If Any One Free To Help Me?! Thanks.--Jarallah (talk) 17:13, 20 May 2016 (UTC)

Always quote the value when you use the field timestamp

I just found out the following:

The slow version takes on dewiki_p about 10 seconds (may be faster, depending on cached data, but never faster than 2 seconds)

SELECT * FROM logging WHERE log_type = 'delete' AND log_timestamp BETWEEN 20190505000000 and 20190506000000;

The fast version takes a fragment of a second

SELECT * FROM logging WHERE log_type = 'delete' AND log_timestamp BETWEEN '20190505000000' and '20190506000000';

So: Using quotes is sure a good idea. --Wurgl (talk) 11:13, 10 December 2019 (UTC)