如何创建动态SQL [英] how to create dynamic sql

查看:59
本文介绍了如何创建动态SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想根据年份动态地创建n月的sql ...意味着我要创建过程,因为我希望按年和逐年显示按月和逐月的日期...如果我通过了,则意味着2012年,数据就会像这样...
表jan和1月1日至2月1日,直到jan 1月31日..etcjan表中的列名...像这样,所有月份和该月的日期都应显示...

i want to create dynamically sql for months n dates according to year...Means I want to create procedure in that i want to pass year and year wise month and month wise dates should be display...means if i pass 2012 then data comes like this...
table jan and 01-jan 02-jan till 31 jan..etc column name in the jan table...like this all months and dates of that months should display...

推荐答案

您可以以编程方式创建SQL 查询"(或者更好地使用参数)构建查询字符串.
You may ''dinamically create a SQL query'' building the query string programmatically (or, better, using parameters).


这篇关于如何创建动态SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆