Search Results
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 |
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
how to generate codes for employee using mysql stored procedure?
A stored procedure would look something like this:
DELIMITER $$
DROP PROCEDURE IF EXISTS insertEmployee$$
CREATE PROCEDURE insertEmployee (IN NewName VARCHAR(6))
BEGIN
DECLARE CountStuff VARCHA …
1
vote
0
answers
56
views
Dynamic content update problem
I have three tables:
forms which contains basic information about a form
form_parts which contains information about a certain input field and has a FK to forms (each form parts must have one form_i …
1
vote
1
answer
2k
views
Get previous and next row from result set help
I have to get "relevant" results from a table by joining it on another table and filtering the results on parent id and current id, this all goes fine until your current id is either the first or the …
0
votes
2
answers
223
views
SELECT multiple times based on changed dates
I'm trying to select different types of data depending on a payment method which is a simple intersection table with columns "id" (INT PK) , "customer_id" (INT FK), "payment_method_id" (INT FK) and "d …
0
votes
Accepted
SELECT multiple times based on changed dates
In the end what I did was select multiple times instead of just once, so for each result that I had I selected the next date_changed to get the period of time in between the two rows and when I had al …
2
votes
Accepted
How to make table with row name and column name
You should revise your table structure.
You are trying to put too many different things into one table.
What you could do is have multiple tables like so:
Table: site
Has an ID and all other detai …
3
votes
Alter TEXT column to NOT NULL when there is existing NULL rows
Run this query:
UPDATE tablename SET textname = "" WHERE textname IS NULL
after running that you can change the table structure so it does not allow null values anymore.
I recommend checking the cod …
0
votes
Move large mysql table data from one server to another
You could use a cron job to connect to the existing database, make a backup of the table, select the rows you need to move (over one week old) disconnect from the sql server, connect to the new serve …
7
votes
1
answer
9k
views
Subquery can't find column from superquery's join
I currently have this SQL statement (I'm using MySQL):
SELECT
CONCAT_WS(
', ', count(DISTINCT CONCAT(emailaddress, '_', e.id)),
(
SELECT GROUP_CONCAT(items SEPARATOR '; ') as OneTimeItems …
0
votes
Mysql cannot import from text file
error 1366 incorrect integer value: '""' for column 'word_id' at row 3
This error is logical, basically, an empty string is not a number. That's the first problem.
Also I tried using null, quotes, …
0
votes
1
answer
307
views
Can you use multiple types of indexes in one composite index
I've built a covering index for a pretty big query which has already halved the select time.
Now, all the columns are just INT(11)'s so there isn't a problem there but one of the columns is a VARCHAR …
3
votes
1
answer
3k
views
How to optimize a Full Text Search
So we have this VARCHAR(255) column called code, which is a string of varying size we use in a WHERE clause.
Doing this search slows the query down by about 300ms and since the query is run a few hun …