Home > database >  SQL database query
SQL database query

Time:09-17

The problem is how to write, please seek advice,

CodePudding user response:

If the string is SDate
Select * from sdutent where left (SDate, 4) & gt;
='2018'If the date format, format take years before first compared with conditions
Select * from sdutent where right (convert (varchar (10), SDate), 4) & gt;='2018'

CodePudding user response:

Forget the ms conditions,
Select * from sdutent where right (convert (varchar (10), SDate), 4) & gt; And SSex=='2018' 'female'

If yes, please post to the point

CodePudding user response:

refer to the second floor nebuung response:
forget on ms conditions,
Select * from sdutent where right (convert (varchar (10), SDate), 4) & gt; And SSex=='2018' 'female'

If yes, please post to points

Ok, thank you

CodePudding user response:

refer to the second floor nebuung response:
forget on ms conditions,
Select * from sdutent where right (convert (varchar (10), SDate), 4) & gt; And SSex=='2018' 'female'

If yes, please post to points


1, convert the function, to specify a date format, or conversion of data, is not expected results,
2, on the columns is not recommended for calculation, should be written in such form where SDate & gt; '2018-01-01' and SSex='woman'
Next:matlab
  • Related