Use mysql variable for millisecond precision in DATETIME

220 Views Asked by At

I am trying to execute this sql script :

SET @microSecondPrecision:=3;

CREATE TABLE DATA_OHLCV (date DATETIME(@microSecondPrecision) NOT NULL);'

and I get an sql syntaxe error. I tried to use SELECT @microSecondPrecision; instead of @microSecondPrecision but still I get a sql syntaxe error.

I cannot find how to une my variable. Can someone help me please ?

Thank you in advance for your help. `

0

There are 0 best solutions below