Null (MySQL)

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen

Controleren op null

select * from product_tmp where filepath is null;

Controleren op niet-null:

select * from product_tmp where filepath is not null;

Controleren op een lege string:

select * from products if filepath=;

Controleren op een niet-lege string:

select * from products if filepath<>;

of

select * from products if filepath!=;

Null vervangen in expressies

Bv.:

ifnull(tool_subtype,"")

Null toekennen

Voorbeelden:

update root_tmp
set ean_id = null;
update root_tmp
set 

	ean_id = null,
	sku    = null;

Bronnen