Results: 1578
Notes
  • Newest first
  • Oldest first
  • Newest first(All)
  • Oldest first(All)
Get sum of multiple average grouped by specific column
SELECT SUM(avg1) FROM (SELECT user_id, AVG(score) as avg1 FROM results GROUP BY user_id)
in this case results table might have multiple records on 1 user id so basically it gets average score of all users and than sums all average number
by გიორგი უზნაძე
4 years ago
0
MySQL
0
by გიორგი უზნაძე
4 years ago
0
JavaScript
DOM
0
$arr = ['key0' => 'val0','key1' => 'val1', 'key2' => 'val2', 'key3' => 'val3'];
$removeKeys = ['key1', 'key2', 'key3'];
$arr = array_diff_key($arr, array_flip($removeKeys));
by გიორგი უზნაძე
4 years ago
0
PHP
Arrays
1
Why we use async and await in JavaScript?
Async/Await
was created to simplify the process of working with and writing chained promises.
Async
functions return a Promise. If the function throws an error, the Promise will be rejected. If the function returns a value, the Promise will be resolved.
by Luka Tatarishvili
4 years ago
0
HTML
JavaScript
functions
0
Template literal syntax uses dollar sign
$
followed by curly brackets
${expression}
let name = 'George'
let age = 25

document.write(`My name is ${name} and I am ${age} years old!`)
by Valeri Tandilashvili
4 years ago
0
JavaScript
Template literals
The 10 Days of JavaScript
1
Function declarations are hoisted. It means, we can use the function before we declare it
hoisted(); // logs "foo"

function hoisted() {
  console.log('foo');
}
Function expressions - anonymous functions are not hoisted:
notHoisted(); // TypeError: notHoisted is not a function

var notHoisted = function() {
   console.log('bar');
};
by Valeri Tandilashvili
4 years ago
0
JavaScript
Function hoisting
2
Functions don't need to be defined before they are called. In this example, function
printMe()
is defined after it's called but it works without errors
echo printMe();

function printMe() {
    return 'Print some text';
}
Exception is
conditional function
. In this example function
foo()
will not be defined until the
if ($makefoo)
conditional statement gets executed
$makefoo = true;

/* We can't call foo() from here 
   since it doesn't exist yet,
   but we can call bar() */
// foo();

bar();

if ($makefoo) {
  function foo()
  {
    echo "I don't exist until program execution reaches me.\n";
  }
}

/* Now we can safely call foo()
   since $makefoo evaluated to true */

if ($makefoo) foo();

function bar() 
{
  echo "I exist immediately upon program start.\n";
}
Functions within functions. Function
bar()
will not be defined until the function
foo()
is executed
function foo() 
{
  function bar() 
  {
    echo "I don't exist until foo() is called.\n";
  }
}

/* We can't call bar() yet
   since it doesn't exist. */
// bar();


foo();

/* Now we can call bar(),
   foo()'s processing has
   made it accessible. */

bar();
Note: All functions in PHP have the global scope - they can be called outside a function even if they were defined inside and vice versa
by Valeri Tandilashvili
4 years ago
0
PHP
PHP official doc
4
Select column comment with some other column specifications
Shows details about each column from
decorations
table including column comments
SHOW FULL COLUMNS FROM decorations
by Valeri Tandilashvili
4 years ago
0
MySQL
1
Select column comment
Selects
is_optional
column comment which exists in
decorations
table using
information_schema
database
SELECT COLUMN_COMMENT 
FROM information_schema.COLUMNS 
WHERE TABLE_SCHEMA = 'geiger' 
    AND TABLE_NAME = 'decorations' 
    AND COLUMN_NAME = 'is_optional'
by Valeri Tandilashvili
4 years ago
0
MySQL
Column comment
1
Set column comment
Sets new comment for
name
column in
channels
table
ALTER TABLE `channels` CHANGE `name` `name` varchar(255) COMMENT 'name of channel'
by Valeri Tandilashvili
4 years ago
0
MySQL
Column comment
1
Results: 1578