I have a problem ordering my stored procedure by a parameter given by a user, I have tried reading but the solutions I have tried won’t work. So, is there somebody who can help me? I would like it to …
Tag: mysql
SQL BETWEEN for text vs numeric values
BETWEEN is used in a WHERE clause to select a range of data between two values. If I am correct whether the range’s endpoint are excluded or not is DBMS specific. What I can not understand in the following: If I have a table of values and I do the following query: The query returns as results rows including calories
Mysql: Update field of most latest record
I’m trying to update the latest record where name is John (John has multiple records but different ID) but I seem to be in a bind. What’s wrong with my query? UPDATE messages_tbl SET is_unread=1 …
MySQL concatenation operator
I don’t know concatenation operator for MySQL. I have tried this code for concatenation: SELECT vend_name || ‘ (‘ || vend_country || ‘)’ FROM Vendors ORDER BY vend_name; But it didn’t work. Which …
How to sync two MySQL tables?
If I have a table (lets call it orders) on one server of mine, named, for example, local. And I have this same table one another server of mine, named, for example, remote. My problem is, what is the best way to sync these two tables? I would like a solution that replaces a registry if the local is different
MySQL INSERT INTO … VALUES and SELECT
Is there a way to insert pre-set values and values I get from a select-query? For example: I have the value of “A string” and the number 5, but I’ve to find the [int] value from a select like this: that gives me that id to put inside table1. How to merge this into one statement? Answer Use an insert
How can I temporarily disable a foreign key constraint in MySQL?
Is it possible to temporarily disable constraints in MySQL? I have two Django models, each with a foreign key to the other one. Deleting instances of a model returns an error because of the foreign key constraint: Is it possible to temporarily disable constraints and delete anyway? Answer Try DISABLE KEYS or Make sure to after.
mysql change all values in a column
I want to change all values in the tablecolumn “Quellendatum”. When the row-value is 2005-06-20 then it should be replaced with 2012-06-20. When the row-value is NULL or empty, then it should be …
select users have more than one distinct records in mysql
For a table that holds the records of user’s webpages visiting behavior, how can I select users that visit more than one webpages. The structure of this tables is: userId webpageId …
MYSQL How do I Select all emails from a table but limit number of emails with the same domain
As the topic sugests I want to select all emails in the list. But limit the number of emails with the same domain. Lets say i have 500 gmail adressses. And 2 example.com adresses. .. and so on.. …