What is multiple variable?

|
2021-10-22 11:05:36
MasterZiv 2021-10-21 19:18:39
Unless you ask a question it cannot be answered

Look

MasterZiv 2021-10-22 11:06:37
2021-10-22 11:04:27
I want to store following value into a multiple variable

What is multiple variable?

2021-10-22 11:06:53
Table variable it’s the name
2021-10-22 11:07:05
But it doesn’t work
2021-10-22 11:07:19
Just can save data
2021-10-22 11:07:34
But cannot use it
MasterZiv 2021-10-22 11:08:40
2021-10-22 11:06:53
Table variable it’s the name

I don’t understand a thing, sorry

2021-10-22 11:08:46
2021-10-22 11:06:53
Table variable it’s the name

Or temporary table

2021-10-22 11:09:09
MasterZiv 2021-10-22 11:08:40
I don’t understand a thing, sorry

Don’t know table variables?

2021-10-22 11:09:21
MasterZiv 2021-10-22 11:08:40
I don’t understand a thing, sorry

Okey no problem bro

MasterZiv 2021-10-22 11:10:25
2021-10-22 11:06:53
Table variable it’s the name

there is no table variable here.
Each variable in MySQL can contain only one value of one type. It can’t contain set or vector of values

MasterZiv 2021-10-22 11:11:20
2021-10-22 11:09:09
Don’t know table variables?

there is no table variables here and MySQL doesn’t support something which can be called ‘table variables’

2021-10-22 11:15:25
Okay
MasterZiv 2021-10-22 11:17:34
If this SELECT returns more then one row, the @data variable will contain value from the first or the last row, but only one value, other values will be erased
2021-10-22 11:18:23
Yea I noticed that, it just stores one value
LexaMV 2021-10-22 14:04:59
hi all, please help me
LexaMV 2021-10-22 14:06:37
if i have to connect with MySQL i use connection.OpenAsync () or connection.Open ();
LexaMV 2021-10-22 14:06:55
remote MySQL
Ganesh G 2021-10-22 15:03:49
Hi all,

Anyone have upgradtion documentation of MySQL 5.5 on windows

Alirezadhb 2021-10-22 18:01:12
mysql_en-13595.jpg
hi guys i have a database with tables like this, i want to count number of each stream_type (0 or 1) and vod_type (0 or 1) in a collection . i tried joining them like this but the result is not right
select c.id,
c.name,
count(IF(s.stream_type = 0, 1, null)) as channelCount,
count(IF(s.stream_type = 1, 1, null)) as radioCount,
count(IF(v.vod_type = 0, 1, null)) as movieCount,
count(IF(v.vod_type = 1, 1, null)) as seriesCount
from collection c
left join collection_stream cs on c.id = cs.collection_id
left join stream s on s.id = cs.stream_id
left join collection_vod cv on c.id = cv.collection_id
left join vod v on v.id = cv.vod_id
group by c.id
Alirezadhb 2021-10-22 18:03:14
Alirezadhb 2021-10-22 18:01:12
hi guys i have a database with tables like this, i want to count number of each stream_type (0 or 1) and vod_type (0 or 1) in a collection . i tried joining them like this but the result is not right
select c.id,
c.name,
count(IF(s.stream_type = 0, 1, null)) as channelCount,
count(IF(s.stream_type = 1, 1, null)) as radioCount,
count(IF(v.vod_type = 0, 1, null)) as movieCount,
count(IF(v.vod_type = 1, 1, null)) as seriesCount
from collection c
left join collection_stream cs on c.id = cs.collection_id
left join stream s on s.id = cs.stream_id
left join collection_vod cv on c.id = cv.collection_id
left join vod v on v.id = cv.vod_id
group by c.id

if code is not readable:
https://hastebin.com/afadufimuv.sql

adinath_kamode 2021-10-22 19:33:00
Hello, I have following data,
Col1 Col2. Col3
1 ABC 10
1. ABC. 15

Select * from table1 order by col1,col2 ;
What will be order of col3 in output.

MasterZiv 2021-10-22 19:34:31
Alirezadhb 2021-10-22 18:01:12
hi guys i have a database with tables like this, i want to count number of each stream_type (0 or 1) and vod_type (0 or 1) in a collection . i tried joining them like this but the result is not right
select c.id,
c.name,
count(IF(s.stream_type = 0, 1, null)) as channelCount,
count(IF(s.stream_type = 1, 1, null)) as radioCount,
count(IF(v.vod_type = 0, 1, null)) as movieCount,
count(IF(v.vod_type = 1, 1, null)) as seriesCount
from collection c
left join collection_stream cs on c.id = cs.collection_id
left join stream s on s.id = cs.stream_id
left join collection_vod cv on c.id = cv.collection_id
left join vod v on v.id = cv.vod_id
group by c.id

The result is not right, but what it is? What is wrong with it?

MasterZiv 2021-10-22 19:35:07
Alirezadhb 2021-10-22 18:01:12
hi guys i have a database with tables like this, i want to count number of each stream_type (0 or 1) and vod_type (0 or 1) in a collection . i tried joining them like this but the result is not right
select c.id,
c.name,
count(IF(s.stream_type = 0, 1, null)) as channelCount,
count(IF(s.stream_type = 1, 1, null)) as radioCount,
count(IF(v.vod_type = 0, 1, null)) as movieCount,
count(IF(v.vod_type = 1, 1, null)) as seriesCount
from collection c
left join collection_stream cs on c.id = cs.collection_id
left join stream s on s.id = cs.stream_id
left join collection_vod cv on c.id = cv.collection_id
left join vod v on v.id = cv.vod_id
group by c.id

At least you have wrong group by here

MasterZiv 2021-10-22 19:36:51
Alirezadhb 2021-10-22 18:01:12
hi guys i have a database with tables like this, i want to count number of each stream_type (0 or 1) and vod_type (0 or 1) in a collection . i tried joining them like this but the result is not right
select c.id,
c.name,
count(IF(s.stream_type = 0, 1, null)) as channelCount,
count(IF(s.stream_type = 1, 1, null)) as radioCount,
count(IF(v.vod_type = 0, 1, null)) as movieCount,
count(IF(v.vod_type = 1, 1, null)) as seriesCount
from collection c
left join collection_stream cs on c.id = cs.collection_id
left join stream s on s.id = cs.stream_id
left join collection_vod cv on c.id = cv.collection_id
left join vod v on v.id = cv.vod_id
group by c.id

Split this query to streams and vods using UNION ALL

Alirezadhb 2021-10-22 20:13:55
MasterZiv 2021-10-22 19:34:31
The result is not right, but what it is? What is wrong with it?

The numbers are greater than what they should be

Alirezadhb 2021-10-22 20:14:05
MasterZiv 2021-10-22 19:36:51
Split this query to streams and vods using UNION ALL

Hmm I’ll try that thanks

MasterZiv 2021-10-22 20:33:21
Alirezadhb 2021-10-22 20:13:55
The numbers are greater than what they should be

Split the query

MasterZiv 2021-10-22 20:34:26
Alirezadhb 2021-10-22 20:13:55
The numbers are greater than what they should be

You must have carthesian product there between two alternatives

Alirezadhb 2021-10-22 21:54:05
MasterZiv 2021-10-22 20:34:26
You must have carthesian product there between two alternatives

thanks bro, i split the query and used union and it’s fixed now

Gakume Hyoma 2021-10-24 07:47:21
mysql_en-13613.jpg
I am learning MySQL right now. At this step, I need to remove the duplicates shown in the result below, where the pair of AID and BID is the same except they swap position. Could someone enlighten me on this? Thank you
Gakume Hyoma 2021-10-24 07:51:55
Gakume Hyoma 2021-10-24 07:47:21
I am learning MySQL right now. At this step, I need to remove the duplicates shown in the result below, where the pair of AID and BID is the same except they swap position. Could someone enlighten me on this? Thank you

hmmmm, I solved this by only including the result of A.StuID < B.StuID . Not sure this is the intended solution or not

MasterZiv 2021-10-24 08:50:37
Gakume Hyoma 2021-10-24 07:51:55
hmmmm, I solved this by only including the result of A.StuID < B.StuID . Not sure this is the intended solution or not

For telling you if this is intended solution one at least should know your task

MasterZiv 2021-10-24 08:52:56
Gakume Hyoma 2021-10-24 07:47:21
I am learning MySQL right now. At this step, I need to remove the duplicates shown in the result below, where the pair of AID and BID is the same except they swap position. Could someone enlighten me on this? Thank you

I can only say your query is over complicated.

Gakume Hyoma 2021-10-24 08:58:59
MasterZiv 2021-10-24 08:50:37
For telling you if this is intended solution one at least should know your task

mysql_en-13617.jpg

|