Reputation: 457
I am trying to use AS in my MYSQL query below:
select ddb.customer_id, ddb.eta,ddb.vessel from tb_po
where transport_mode='SEA'
and date(mv_eta_pod) between '2010-01-01' and '2020-12-31' AS ddb;
However, it tells me I am having an error in the AS
keyword. Is there something wrong with what I am doing?
Upvotes: 1
Views: 299
Reputation:
Make sure to put AS directly after the thing you want to create an alias for (ex. a table or a specific row).
Upvotes: 1
Reputation: 4956
Use AS
to define alias for the table you use i.e. tb_po
.
select ddb.customer_id, ddb.eta,ddb.vessel from tb_po AS ddb
where transport_mode='SEA'
and date(mv_eta_pod) between '2010-01-01' and '2020-12-31';
Upvotes: 4