i have account table which consists of account name,card no
and card no consists 16 digits now i want to retrieve the
data if card no starts from 4 then it should print visa and
if it starts from 5 then it should print master so plse help
me to write simple query with out store procs .
Answer Posted / kiranu
Hi every one
select name, cardno(case substring(cardno,1,1)when '4' then
'Visa' when '5' then 'Master' end) as Result from account;
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is a system database and what is a user database?
What is the dbcc command and why is it used?
Please illustrate physical database architecture? : SQL Server Architecture
You have to store user responses of ‘yes’ and ‘no’ what kind of data type is best suited for this task?
Define left outer join in sql server joins?
What will happen if a column containing char type data is changed to the nchar data type?
Do you know how to send email from database?
How to write a query with a right outer join in ms sql server?
hi, the following are the outputs of sp_spaceused and sp_tempdbspace sp_spaceused ------------ database size unallocated size tempdb 77752.95 MB 28026.99 MB sp_tempdbspace ------------- database size spaceused tempdb 77752.945312 1.007812 the unused space in sp_spaceused is nearly 28 Gb and in sp_tempdbspace is nearly 76 Gb cany any one explain about this output and why its giving different results.
what do you understand by change data capture?
explain what is a schema in sql server 2005? Explain how to create a new schema in a database? : Sql server database administration
How to connect to a sql server using odbc_connect()?
What are the types of subquery?
What happens if you insert a duplicate key for the primary key column in ms sql server?
What is index fragmentation in ms sql server?