# Miscellaneous > SQL Scripts >  solving query

## svibuk

having this query which was working fine
but started giving syntax error
need to solve this query to get the result


SELECT a.NAME,(case when (a.XLNAME IS null) OR (a.XLNAME = ' '))
a.NAME else a.XLNAME end) as E_COL ,[order],width,b.column_name,
b.data_type FROM (SELECT * FROM XLS_XLS where status=1 and [order]<>0)
as A Left Join
(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='STUDENT')
as B ON A.NAME=B.COLUMN_NAME ORDER BY A.[order]

----------


## rmiao

For which rdbms? Can you post error message?

----------

