Click here to Skip to main content
15,900,725 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi expert!!!!


i create one query for select data and this query select only 5 field of table,

this query also use for fill dataTable, in dataTable all column present. so its give error.

so how can use select query with only column destination, i don't select all column data because of heavy datatable.

in shot query for select null value from any particular "column".
Posted
Comments
Vijay Walunj,Navi mumbai 6-Oct-12 6:30am    
i didn't get u.can you able to explain your problem with example
Member 9444634 6-Oct-12 6:36am    
for example: a, b,c,d,e this is five column

and i want to select only data of a and d.
and set null to b,c,e column.
Member 9444634 6-Oct-12 6:37am    
just like this:

select a,b=null,c=null,d,e=null from table_name

1 solution

Try:
SQL
SELECT a AS a, null AS b, null AS c, d AS d FROM myTable
 
Share this answer
 
Comments
Member 9444634 6-Oct-12 7:09am    
thx....
OriginalGriff 6-Oct-12 7:17am    
You're welcome!

(BTW: try to avoid txtspeak here - it seriously annoys some people, and can affect how your questions or comments are received)
psychic6000 6-Oct-12 7:43am    
i would say, why are you still selecting those columns at all... just use
select a,d from my table
OriginalGriff 6-Oct-12 7:47am    
Probably, because he needs to have blank columns in his table and he is using the returned data as a Data Source.
Member 9444634 6-Oct-12 8:10am    
ya, i want only definition of column so...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900