如何选择孩子? [英] how to select the child?

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

问题描述

大家好,

我正在开发一个应用程序Webdynpro java,我需要编写一个SQL查询。我有一个场景,我需要根据业务组显示数据。每个网站下面都有许多商业团体,有许多网站,所有这些网站都以给定的形式填写数据。当用户选择业务组以及月份和年份时,它应该在该业务组下以站点方式显示所有数据。然后SQL查询会是什么?

Hi all,
I am developing an application Webdynpro java where I need to write a SQL query. I have scenario where I need to display data according to Business group. There are numerous business groups under each of them there are numerous sites and all these sites have data filled by them in a given form. When the user select the Business Group and month and year, it should show the data all site-wise under that business group. Then what will be the SQL query for that?

推荐答案

先前的评论是正确的。有关架构的更多信息是必需的。



一般来说,你需要2件事。



1 )一个sql查询



2)java代码执行代码并迭代返回的结果。



我根本无法帮助#2。我不是一个java编码器。



我可以给你一个从#1开始的框架,但我知道它不完整,应该只是作为一个起点。



您的SQL查询类似于:



select

Field01,

Field02,

...

Field_n
来自YourTable的


其中BusinessGroup ='group_x'



select关键字后跟一个以逗号分隔的列名列表(Field01等)。

from keyword后面跟着你需要返回的表的名称(在我的例子中为Yourtable)。

where关键字后跟一个逻辑表达式,对于你想要的记录都是true (在这种情况下,名为BusinessGroup的列需要在单引号中包含字符串group_x)



我希望这能让你开始。

Don
The prior comment is correct. More information about the schema is needed.

In general, you will need 2 things.

1) a sql query

2) the java code to execute the code and iterate over the results returned.

I cannot help with #2 at all. I am not a java coder.

I can give you a framework to start from for #1 but I know it is incomplete and should just be viewed as a starting point.

Your SQL query will be something like:

select
Field01,
Field02,
...
Field_n
from YourTable
where BusinessGroup = 'group_x'

The select keyword is followed by a list of column names (Field01 etc) separated by commas.
The from keyword is followed by the name of the table(Yourtable in my example) that contains the rows you need to return.
The where keyword is followed by a logical expression that is true for the records you want returned to you.(the column named BusinessGroup needs to contain the string in single quotes in this case group_x)

I hope this gets you started.
Don


这篇关于如何选择孩子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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