Reputation
25,727
Next tag badge:
95/100 score
23/20 answers
Badges
5 46 89
Newest
 Taxonomist
Impact
~1.1m people reached

6h
comment INSERT data on MySQL to specific position based on its value (similar to ORDER BY)
I'm pretty sure I had a SQLfiddle example. If I couldn't find the link, so here is another one: SQLfiddle
6h
comment What order do foreign key constraints run in? Why does my foreign key not work after import?
You did not add the UNIQUE index/constraint on tags(organization, id).
6h
comment INSERT data on MySQL to specific position based on its value (similar to ORDER BY)
It's not implicitly ordered. It often is - but not always. Too many exceptions, to rely on it.
6h
comment INSERT data on MySQL to specific position based on its value (similar to ORDER BY)
What Aaron said above. MySQL, for simple queries like select * from tablename; returns results (usually) in the order of the clustered index but it's very easy to write a counter-example query that returns results using some different order.
7h
comment What order do foreign key constraints run in? Why does my foreign key not work after import?
Please show the CREATE TABLE script. If both columns are not null, then the 1st FK can be dropped. And you should change your 2nd FK if you want deletes to cascade (or keep it as it is if you don't.) If the columns are nullable, it becomes complicated.
7h
comment INSERT data on MySQL to specific position based on its value (similar to ORDER BY)
Why do you think you need order by when you insert? What is the underlying problem you want to solve?
7h
comment What order do foreign key constraints run in? Why does my foreign key not work after import?
Why is the 1st FK needed when you have the 2nd? Why the 1st FK has ON DELETE CASCADE and the second has ON DELETE NO ACTION? What exact statement did you run and you got this error?
7h
comment INSERT data on MySQL to specific position based on its value (similar to ORDER BY)
You use ORDER BY in the SELECT. SQL tables are inherently unordered. (the data may be saved in the disks in some order but there is no guarantee they will be returned the same way.) Just use ORDER BY to get the query results in the order required.
7h
reviewed No Action Needed Give privilege to new created databases in MySQL
7h
reviewed Close Basic Access database help
7h
reviewed Close How to become MySQL trainer?
8h
comment MySQL: delete…where..in( ) vs delete..from..join, and locked tables on delete with subselect
@MorganTocker Thnx, I wasn't sure about this (optimizations and DELETEs). If you think this can be added in my answer, feel free to edit.
9h
revised Problem I need to Insert Data every 5 minutes, not working
added 314 characters in body
13h
comment SQL retrieve last elements of table using group by like behaviour
But is giving 1.9 as max acceptable for you, if there are also 1.10, 1.11, ..., 1.22 versions?
13h
revised Query Access Question
added 32 characters in body
13h
comment SQL retrieve last elements of table using group by like behaviour
I'm saying that the version is a varchar and using MAX will use lexicographic ordering - where '1.10' is before '1.2'. All 4 answers did not consider this. The answer is probably not a simple sql query.
14h
comment concatenating columns from multiple unrelated 1-row resultsets
@Vérace Uisng a comma (a , b instead of a CROSS JOIN b) is just using old (pre-92) SQL syntax, before the introduction of JOIN syntax. The two queries are equivalent and perfectly valid - although the explicit CROSS JOIN is preferred these days.
14h
comment SQL retrieve last elements of table using group by like behaviour
Yours and Jehad's answer would work fine if the versionwas numeric. Now they suffer from the same issue (consider version='1.10')
14h
comment SQL retrieve last elements of table using group by like behaviour
What is the HAVING MAX(version) supposed to do and how does it work? I suggest you add a detailed explanation of this obscure piece of code.
14h
comment SQL retrieve last elements of table using group by like behaviour
@JehadKeriaki I agree. Unfortunately, none of the supplied answers will work correctly in all cases.