本文介绍了在sql server中,我们有一个表,其中有许多列.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在sql server中,我们有一个表,其中许多列,例如Fname Lname U_id和Uname.Uname是主键.有很多重复的数据,但我没有重复的数据.其中Uname =?我要代替?....

in sql server we have a table in which many of column such as Fname Lname U_id and Uname.Uname is primary key..i get the velue of Fname Lname. there are many data is repeated but i get not repeated data. where Uname=? what i do in place of ?....

推荐答案

SELECT * FROM tbUserDetails WHERE UserNAME = ?


这里 ?表示您要从数据库中获取哪些用户信息.您必须对此清楚.您可以像这样使用:


Here ? means which user information you want to fetch from database. You''ll have to be clear on that. You can use like:

SELECT * FROM tbUserDetails WHERE UserNAME = 'amit'


*表示表中的所有列.如果只需要表中的特定列,则可以将 *替换为用逗号分隔的列名.像这样尝试:


Here * means all the columns from the table. If you want only specific columns from table then you can replace the * to your column names separated with comma. Try like this:

SELECT FName, LName, Address, EmailID, PhoneNo FROM tbUserDetails WHERE UserNAME = 'amit'



希望对您有所帮助.
--Amit



Hope it helps.
--Amit




这篇关于在sql server中,我们有一个表,其中有许多列.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 16:31