query creation compatible for linux/windows.