mysql 存 储过 程 查询 某一字段外的所有字 段
2009-06-22 10:00
323 查看
<!--
/* Font Definitions */
@font-face
{font-family:"MS 明朝";
panose-1:2 2 6 9 4 2 5 8 3 4;
mso-font-alt:"MS Mincho";
mso-font-charset:128;
mso-generic-font-family:roman;
mso-font-pitch:fixed;
mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:宋体;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"MS ゴシック";
panose-1:2 11 6 9 7 2 5 8 2 4;
mso-font-alt:"MS Gothic";
mso-font-charset:128;
mso-generic-font-family:modern;
mso-font-pitch:fixed;
mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
@font-face
{font-family:Century;
panose-1:2 4 6 4 5 5 5 2 3 4;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:647 0 0 0 159 0;}
@font-face
{font-family:"/@SimSun";
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"/@MS 明朝";
panose-1:2 2 6 9 4 2 5 8 3 4;
mso-font-charset:128;
mso-generic-font-family:roman;
mso-font-pitch:fixed;
mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
@font-face
{font-family:"MS Pゴシック";
panose-1:2 11 6 0 7 2 5 8 2 4;
mso-font-charset:128;
mso-generic-font-family:modern;
mso-font-pitch:variable;
mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
@font-face
{font-family:"/@MS Pゴシック";
panose-1:2 11 6 0 7 2 5 8 2 4;
mso-font-charset:128;
mso-generic-font-family:modern;
mso-font-pitch:variable;
mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
@font-face
{font-family:"/@MS ゴシック";
panose-1:2 11 6 9 7 2 5 8 2 4;
mso-font-charset:128;
mso-generic-font-family:modern;
mso-font-pitch:fixed;
mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0mm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:none;
font-size:10.5pt;
mso-bidi-font-size:12.0pt;
font-family:Century;
mso-fareast-font-family:"MS 明朝";
mso-bidi-font-family:"Times New Roman";
mso-font-kerning:1.0pt;}
pre
{margin:0mm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"MS ゴシック";
mso-bidi-font-family:"MS ゴシック";}
/* Page Definitions */
@page
{mso-page-border-surround-header:no;
mso-page-border-surround-footer:no;}
@page Section1
{size:595.3pt 841.9pt;
margin:99.25pt 30.0mm 30.0mm 30.0mm;
mso-header-margin:42.55pt;
mso-footer-margin:49.6pt;
mso-paper-source:0;
layout-grid:18.0pt;}
div.Section1
{page:Section1;}
-->
mysql
存
储过
程
查询
某一字段外的所有字
段
/* Font Definitions */
@font-face
{font-family:"MS 明朝";
panose-1:2 2 6 9 4 2 5 8 3 4;
mso-font-alt:"MS Mincho";
mso-font-charset:128;
mso-generic-font-family:roman;
mso-font-pitch:fixed;
mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:宋体;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"MS ゴシック";
panose-1:2 11 6 9 7 2 5 8 2 4;
mso-font-alt:"MS Gothic";
mso-font-charset:128;
mso-generic-font-family:modern;
mso-font-pitch:fixed;
mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
@font-face
{font-family:Century;
panose-1:2 4 6 4 5 5 5 2 3 4;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:647 0 0 0 159 0;}
@font-face
{font-family:"/@SimSun";
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"/@MS 明朝";
panose-1:2 2 6 9 4 2 5 8 3 4;
mso-font-charset:128;
mso-generic-font-family:roman;
mso-font-pitch:fixed;
mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
@font-face
{font-family:"MS Pゴシック";
panose-1:2 11 6 0 7 2 5 8 2 4;
mso-font-charset:128;
mso-generic-font-family:modern;
mso-font-pitch:variable;
mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
@font-face
{font-family:"/@MS Pゴシック";
panose-1:2 11 6 0 7 2 5 8 2 4;
mso-font-charset:128;
mso-generic-font-family:modern;
mso-font-pitch:variable;
mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
@font-face
{font-family:"/@MS ゴシック";
panose-1:2 11 6 9 7 2 5 8 2 4;
mso-font-charset:128;
mso-generic-font-family:modern;
mso-font-pitch:fixed;
mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0mm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:none;
font-size:10.5pt;
mso-bidi-font-size:12.0pt;
font-family:Century;
mso-fareast-font-family:"MS 明朝";
mso-bidi-font-family:"Times New Roman";
mso-font-kerning:1.0pt;}
pre
{margin:0mm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"MS ゴシック";
mso-bidi-font-family:"MS ゴシック";}
/* Page Definitions */
@page
{mso-page-border-surround-header:no;
mso-page-border-surround-footer:no;}
@page Section1
{size:595.3pt 841.9pt;
margin:99.25pt 30.0mm 30.0mm 30.0mm;
mso-header-margin:42.55pt;
mso-footer-margin:49.6pt;
mso-paper-source:0;
layout-grid:18.0pt;}
div.Section1
{page:Section1;}
-->
mysql
存
储过
程
查询
某一字段外的所有字
段
-- 建立存 储过 程
create proc testproc
(
--@tablename 为 table 参数
@tablename nvarchar(50),
)
as
--
建立
临时
表
(内存中
)
create table #temptable
--
将你传
入的@tablename
表进
行复
制至临时
表#temptable
中(在内存)
select * into #temptable from @tablename
-- 删 除临时 表中的列, 名字为 name
alter table #temptable drop column name
-- 查询 一把 临时 表 , 得到 结 果
select * from #temptable
我没在 查询 分析器里跑 过 , 如果多表 联查 得改吧 ...
按照 单 表 查询 来 说 , 理 论应该 成功的 ...
如果传 入的@tablename 不存在, 临时 表查询 出来是空的...
相关文章推荐
- mysql中查询数据库中所有的字段及表,数据库名
- Mysql中查询某个数据库中所有表的字段信息
- mysql如何查询一个表中所有字段的名字
- mysql根据字段查询数据库中的存在该字段的所有数据表
- mysql 为某一数据库下所有表中添加相同字段
- Mysql中查询某个数据库中所有表的字段信息
- mysql中查询到包含该字段的所有表名
- mysql not in 查询某个字段的值不包含在另一个表的相应字段的所有值里面
- MySQL查询所有字段
- MySQL查询某个字段不重复的所有记录
- mysql查询某个表的所有字段
- MySQL查询某个字段不重复的所有记录
- MySQL查询某个字段不重复的所有记录
- mysql查询数据库所有表和字段及其注释
- mysql查询分组后显示某一字段最大值行
- mysql使用sql语句查询数据库所有表注释已经表字段注释
- 查询mysql表中所有字段详细信息,查询mysql表字段
- MySql同时查询三个不关联的表,同时获取到三个表的数据,并按照某一字段排序
- MySQL---表a中某一字段名为“55,56,”,去表d中查询其对应的值
- mysql查询某字段不重复的所有行