mysql-variables Questions
2
Solved
How do I select a random row from the database based on the probability chance assigned to each row.
Example:
Make Chance Value
ALFA ROMEO 0.0024 20000
AUDI 0.0338 35000
BMW 0.0376 40000
CHEVROLET...
Postilion asked 7/11, 2015 at 22:15
3
Solved
I set two user-defined variables as shown below but after some time, I forgot the names:
SET @a = 2, @b = 3;
So, does MySQL have the command that displays all user-defined variables?
Delp asked 25/3, 2015 at 15:30
3
Solved
I'm using MySQL in localhost (in ubuntu and also in windows). I want to set a global variable, and I have tried in all ways but even though I get an "ok" message from mysql, then when I d...
Wadesworth asked 21/11, 2013 at 2:5
4
Is there a possibility to do something like this?
SELECT
@z:=SUM(item),
2*@z
FROM
TableA;
I always get NULL for the second column. The strange thing is, that while doing something like
SELE...
Hagiographa asked 23/5, 2013 at 13:41
12
Solved
The following is the simplest possible example, though any solution should be able to scale to however many n top results are needed:
Given a table like that below, with person, group, and a...
Pulsar asked 24/8, 2012 at 17:0
3
Solved
Is there is a way to delete records using WHERE IN @VARIABLE?
-- DEMO TABLE
CREATE TABLE people (
id int AUTO_INCREMENT NOT NULL,
name varchar(100),
age int,
active smallint DEFAULT 0,
PRIMAR...
Froggy asked 3/7, 2021 at 14:33
3
Solved
Hi I am looking to create a table with date as column name.
I am using this code to Add column to the table:
DROP PROCEDURE IF EXISTS filldates;
DELIMITER |
CREATE PROCEDURE filldates(dateStart ...
Accalia asked 8/5, 2017 at 13:33
6
Solved
I am using SET GLOBAL <variable> = <value> to modify dynamic settings in mysql and I am wondering if there is some way to get the default value for each variable? For instance, if I use...
Blather asked 21/4, 2019 at 12:34
3
From MySQL Manual the output of the following query is not guaranteed to be same always.
SET @a := 0;
SELECT
@a AS first,
@a := @a + 1 AS second,
@a := @a + 1 AS third,
@a := @a + 1 AS fourth,
@...
Kolomna asked 12/8, 2016 at 17:39
2
I have a MySQL query which works fine when executed directly on my local MySQL Database, but shows a different result when executed via PHP.
SELECT a.id, a.title, a.public, a.sysstamp, a.password,...
Conservatoire asked 5/11, 2014 at 10:46
6
Solved
We have a table in MySql with arround 30 million records, the following is table structure
CREATE TABLE `campaign_logs` (
`domain` varchar(50) DEFAULT NULL,
`campaign_id` varchar(50) DEFAULT NUL...
Truth asked 16/3, 2015 at 12:20
2
Solved
I've searched around for this, but all the similar questions and answers are just different enough not to work.
I have a table with the following fields: person, thing, purdate. A new record is en...
Fragment asked 21/4, 2014 at 20:19
1
© 2022 - 2024 — McMap. All rights reserved.