Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 86951

All versions of MySQL (not Microsoft SQL Server). Please also add a version-specific tag like mysql-5.7 if that is relevant to the question.

0 votes
1 answer
94 views

Check if there are users who are using a common password

Table Structure: userid password adminlevel userid is BIGINT (UNIQUE) password is VARCHAR adminlevel is SMALLINT How do I write a query to get a list of users with adminlevel greater than 0 who …
Yashas's user avatar
  • 365
0 votes
1 answer
220 views

Most efficient way to log user login IPs

I am looking for ideas on how to log user's login IPs without compromising on performance in MySQL. …
Yashas's user avatar
  • 365
1 vote
1 answer
7k views

SQL Query; Admin Log System; Foreign Keys; Retriving multiple rows form different tables at ...

Table A (users) id | name | ip 52433 Yashas 1.1.1.1 512 Admin 5.6.7.8 Table B (admin_record) id | admin | time | date | reason | action 52433 512 2312352 12132 …
Yashas's user avatar
  • 365
2 votes
1 answer
480 views

Timestamp Difference - Syntax Error - Condtitional Selects

TIMESTAMPDIFF(MINUTE, unban, NOW()))) AS difference FROM banned, banned) WHERE name = '%e' I get some syntax error #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL
Yashas's user avatar
  • 365
1 vote

Timestamp Difference - Syntax Error - Condtitional Selects

SELECT name, admin, reason, unban, FROM_UNIXTIME(date, '%Y-%m-%d') AS datetime, HOUR(x.difference) AS HRemain, MINUTE(x.difference) AS MRemain FROM(SELECT SEC_TO_TIME(AVG(TIMESTAMPDIFF(MINUTE, unban …
Yashas's user avatar
  • 365
20 votes
4 answers
351k views

Selecting data from another table using a foreign key [duplicate]

I have two tables A & B. Table A id | name | num Table B id | date | roll id in table B is a foreign key which relates to the id in table A. I want to get the contents of table B where id is given a …
Yashas's user avatar
  • 365