►
Description
Hey, its a SQL sequel! If that hasn't blown your mind, George certainly will when he combines Concatenating and If Statements into one glorious training video.
Referenced code: https://wiki.koha-community.org/wiki/SQL_Reports_Library
Music: https://www.bensound.com
A
A
B
A
Well,
I
don't
know
what
number
we're
up
to,
but
it's
another
video
from
us
number,
six
from
koha
us
and
like
last
week
this
time
we'll
be
talking
about
some
tips
and
tricks
and
fun
things
and
crazy
stuff.
You
can
do
with
sql.
A
Last
week
we
talked
a
little
bit
about
adding
links
to
reports,
which
is
something
you
can
find
in
the
cohab
wiki,
and
we
showed
you
how
to
add
a
link,
and
it
occurred
to
me
that
you
know
that
involves
concatenating
things
and
concatenate
is
a.
Is
a
function,
that's
built
into
sql
that
you
can?
If
you
know
how
to
use
it,
you
can
do
a
lot
of
crazy
stuff
in
coho
with
it.
A
You
can
there's
all
kinds
of
things
you
can
do
with
it.
That
makes
it
useful.
So
I
thought
we'd
talk
about
that.
So
I'm
going
to
start
sharing
my
screen
and
I
always
have
to
figure
out
which
screen
I
want
to
share,
because
I
got
three
of
them
now,
I'm
one
of
those
cool
people
that
has
the
desks
covered
with
monitors.
A
Yeah,
let's
see,
I
got
that
open,
I'm
going
to
move
everything
over
here
so
so
this,
of
course,
is
the
cohot
us
website
it's
cohabitus.org
and
you
can
find
all
these
videos
under
learn
from
us.
If
you
click
there
and
click
on
koa
us
videos,
there's
the
list
of
all
the
videos
we've
done
so
far,
and
this
will
go
right
there
shortly
and
you
know
it
occurs
to
me
that
I
didn't
put
this
up
here,
but
I'm
going
to
put
up
the.
A
I'm
going
to
put
up
the
koha
community
wiki
sql
library,
since
we're
talking
about
sql.
This
is
the
place
in
the
quahog
community,
where
there's
all
of
these
tons
and
tons
of
reports
that
you
that
are
already
built
that
you
can
find
90
of
the
time.
If
I
need
to
report,
that's
the
first
thing
I
do
is
I
go
here
and
I
look
for
something
and
a
lot
of
times.
I
don't
find
something.
That
is
exactly
what
I
want,
but
I
find
something
that's
pretty
close
and
I
can
build
on
that.
A
So
this
is
the
koha
us
demo
site
and
we're
gonna
do
most
of
what
we
want
to
do
here,
but
I'm
going
to
do
a
couple
of
things
in
my
own
site
at
nexsearch
catalog,
because
there's
a
couple
of
things
that
are
that
are
hard
to
set
up
that
I'll.
That
I'll
show
you
in
my
system
that
that
that
are
fun
things
to
do
in
sql
and.
A
A
A
I
called
it
concat1
because
we're
going
to
be
talking
about
concatenation
and
I'm
going
to
run
this
in
a
new
window,
and
this
is
just
an
example
of
let's
say
I
needed
a
report
that
would
show
me
card
numbers
names
and
addresses,
and
this
report
I've
just
got
a
select
and
I've
got
the
fields
laid
out
card
number
surname,
first
name
other
name:
I've
got
all
these
lined
up
and
then
I'm
looking
for
my
sample
patrons
are
always
named
frosty
and
I
give
them
a
card
number
that
starts
with
frost.
A
But
this
comes
up
this
way,
so
if
I
wanted
to
run
a
report
like
this
and
then
copy
and
paste
this
information
into
an
email,
which
is
something
that
I
have
to
do
from
time
to
time,
when
I
go
to
copy
and
paste
this,
if
I
copy
and
paste
it
into
another
program,
it's
going
to
come
out
laid
out
like
a
like
a
csv
file,
and
this
is
not
often
the
best
most
readable
way
to
send
data
from
point
b
yeah.
You
got
to
do
a
lot
of
cleanup
and
cleanup
takes
time.
A
So
if
I
can
spend
four
or
five
hours
writing
a
report
that
makes
it
easier
for
me
to
do
that.
Well,
like
I
just
said,
I'm
gonna
do
that.
A
Actually,
let
me
run
that
first
one
again,
I
shouldn't
have
closed
it.
I
should
keep
these
going,
so
I
can
build
on
them.
So
here
we've
got
the
surname
and
the
first
name
in
separate
fields
and
by
doing
concat,
borrower's
name
comma
space,
borrower's
first
name,
I
can
get
the
name
all
in
one
line,
so
the
next
time
I
want
to
copy
and
paste
this.
I've
got
the
first
name
and
the
last
name
all
in
one
line.
A
So
it's
going
to
be
more
readable
and
it's
going
to
be
easier
to
copy
and
paste
into
something
else.
Nice
and
I
can
go
a
step
further.
You
notice,
I
have
the
the
other
name
here,
which
I
think
we
have
in
our
system.
We
call
that
the
nickname
field,
so
the
next
thing
I
want
to
do
is
I
want
to
find
a
way
to
put
that
into
this
name
over
here,
and
so
what
I'm
going
to
do
is
I'm
going
to
concatenate.
It.
A
So
I've
got
it
wrapped
around
with
parentheses.
A
A
B
A
B
A
A
A
Okay
and
if
it's
false,
if
there
is
data
in
the
other
name,
then
what
I'm
doing
here
is
I'm
concatenating
a
space,
a
parenthesis,
the
borrower's,
nickname
and
then
another
parentheses,
and
that
gets
me
so
I've
got
combined
on
one
line.
I've
got
the
surname.
I've
got
a
comment
as
space.
I've
got
the
first
name
and
if
the
borrower
has
a
nickname,
if
the
borrower's
nickname
is
empty,
that's
it
it's
over.
A
Yes,
including
an
if
then
statement
wow,
so
there's
a
lot
going
on
there.
Yes,
but
once
again
you
know
we've
gone
from
having
three
name
fields
down
to
having
one
name
field.
So
all
of
a
sudden.
This
is
something
really
easy
to
copy
and
paste.
A
A
B
A
Now
that
I've
paid
more
pretty
simply
I've
got
it
all
into
one
line
now,
because
I've
got
what
I
did
in
the
first
one.
I've
got
the
concatenation
and
now
that
I've
got
the
so
I've
got
the
name
concatenation
up
here.
A
So
what
this
does
is
you
know
when
I
concatenate
the
name
I
put
the
comma
into,
I
wrote
that
out
as
a
string
to
concatenate
between
the
two
fields,
concatenate
with
separator.
What
you
do
up
here
is
you
put
the
thing
that
you
want
to
separate
each
piece
that
you're
concatenating.
B
A
I
was
thinking
about
that
before
we
got
together
this
morning.
Let's
see
I
would
need
to
go
to
edit.
A
I
was
thinking
about
the
logic
that
it
takes
to
do
that,
so
I
would
want
to
say
if
I'll
start
with
an
if.
B
B
A
Yes,
that's
what
I'm
going
to
do,
and
this
is
a
lot.
There
are
a
couple
of
different
ways
that
you
can
probably
do
that,
and
this
is
the
way
that
it
occurred
to
me
that
it
would
logically
work.
So
I'm
going
to
say,
if
borrower's
address
to
I'm
going
to
move
that
up
here
if
borrowed
borrower's
address
2
is
empty.
A
A
But
if
borrower's
address
so
borrower's
address
two
equals
empty
is
true,
then
just
give
me
borrower's
address,
but
a
borrower's
address
to
empty
is
false.
Then
I'm
going
to
want
to
concat.
A
B
A
B
A
A
So
that's
just
that's
an
easy
way
to
show.
You
know
an
example
of
concatenation.
A
A
B
A
I
have
a
couple
of
reports
like
this,
where
I'll
want
to
create
notes
to
put
on
patrons
accounts
I'll
get
an
email
from
one
of
my
libraries
saying
we
have
a
patron
that
I
need.
You
know,
there's
a
duplicate
patron
as
a
common
one.
Where
somebody
will.
Let
me
know
that
there's
one
patron
that
has
two
accounts,
which
is
strictly
speaking,
forbidden
in
our
network.
A
B
A
A
B
Yeah,
well,
that's
very
cool.
Well
george,
thank
you
for
sharing
that,
I'm
sure
that's
going
to
help
a
lot
of
people
with
report
building.
I
appreciate
you
showing
us
how
to
use
the
concat
feature
and
the
cat
ws
ws
stands
for
with
separator
the
separator
and
then
also
the
f
statement.