carte blanche
carte blanche

Reputation: 11476

Error Code: 1054. Unknown column 'S.No' in 'order clause'

I am getting the below error while using the following query using "ORDER BY" Clause, S.No (int type) does exist in the table, not sure why am hitting this error? Any ideas how to fix it?

SELECT gerrit_id
FROM gerrits.gerrit_table
WHERE (((SU_version>='00.00.0001')&&(SU_version<='00.00.0006'))
    AND PL='LA.HB.1.1.1'
    AND component='SU_CNSS_BT_FM_LA.HB.1.1.1') 
ORDER BY S.No

Error:-

Error Code: 1054. Unknown column 'S.No' in 'order clause'

Table schema

Field   Type    Null    Key Default Extra
S.No    int(11) NO  PRI NULL    auto_increment
gerrit_id   varchar(45) NO  PRI NULL    
SI  varchar(45) NO  PRI NULL    
component   varchar(45) NO  PRI NULL    
gerrit_owner    varchar(45) NO  PRI NULL    
release_bit int(11) NO  PRI NULL    
picked_bit  int(11) NO  PRI NULL    

Upvotes: 0

Views: 1507

Answers (1)

Daniel Waghorn
Daniel Waghorn

Reputation: 2985

I'm surprised that the DBMS has accepted the column name S.No although try this:

SELECT gerrit_id
FROM gerrits.gerrit_table
WHERE (((SU_version>='00.00.0001')&&(SU_version<='00.00.0006'))
    AND PL='LA.HB.1.1.1'
    AND component='SU_CNSS_BT_FM_LA.HB.1.1.1') 
ORDER BY `S.No`

Upvotes: 4

Related Questions