In my-sql i used a variable c and in a situation i used like c-- to decrement the value of c but while executing i came to know that remaining code in the line get commented, how can i avoid that without using c=c-1;

Hi,

In this kind of situations (need to use keywords in query) you can use "[]" operator. for example, in your case

[c--]

But this will throw error saying that no such column exist. you can try like,

select (c-1) from table

Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.