Mounika Tirumala
asked on
sql query
how to write a query to genate a target column?
can any one help me
can any one help me
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
its not working even iam not getting the logic
Pls post your query .
ASKER
SELECT * , ROW_NUMBER() OVER (Order By employee_id) rnk ,employee_ id= a * 12 FROM
employees
employees
Please rephrase your question. More context is helpful.
And what does
mean?
SQL is a declarative language. It consists of DDL (data definition language) and DML (data manipulation language). A "query" normally denotes a SELECT statement to retrieve data. In this context, there is no "generate". You can only add new calculated columns as already shown in the posts before. SELECT is a DML statement.
On the other hand "generate" can denote creating a new column. This would be the ALTER TABLE statement, which is a DDL statement. E.g.
And what does
to genate a target column?
mean?
SQL is a declarative language. It consists of DDL (data definition language) and DML (data manipulation language). A "query" normally denotes a SELECT statement to retrieve data. In this context, there is no "generate". You can only add new calculated columns as already shown in the posts before. SELECT is a DML statement.
On the other hand "generate" can denote creating a new column. This would be the ALTER TABLE statement, which is a DDL statement. E.g.
ALTER TABLE yourTable
ADD newColumnName INT NULL;
It also could be used to create another table having a target column.
Q1: Could you possibly elaborate a bit as to what you want accomplish.
Q2: What is your source table and its column's names? Every query has to have at least one table to work with. Post it with sample data.
Mike