SasinduRHN
SasinduRHN

Reputation: 31

select data without current year from table

i want to select data current year data should ignored table structure ( year , month , temp_air , dry_temp) Select * from table where year(date)='not current year'` what should i add to "not current year.

Upvotes: 1

Views: 95

Answers (1)

Rahul Tripathi
Rahul Tripathi

Reputation: 172508

You may try like this:

where year(date)!=YEAR(CURDATE())

instead of

where year(date)='not current year'`

You may select whichever columns you want to select and ignore the rest.

SELECT month, temp_air, dry_temp from table where year(date)!=YEAR(CURDATE())

Upvotes: 1

Related Questions