ORACLE 选择一列最大值问题,请大神们帮帮忙!

数据库中有如下表图片说明
要找出表中列2中最大的一行,如这一行:A 4 aaaaa 667,其他列1中A的行不要,
一次类推找出列1中B对应列2中最大的行,列1中C对应列2中最大的行,如何写select语句,请大神们帮忙,谢谢!

6个回答

//以这个为准,上面个别逗号写成中文了,把table_name 替换成你自己的表名
select a.列1,a.列2,
(select 列3 from table_name where 列1=a.列1 and 列2=a.列2) 列3,
(select 列4 from table_name where 列1=a.列1 and 列2=a.列2) 列4
from 
(select 列1,max(列2) 列2 from table_name group by 列1) a
u014074697
张大教主 不客气,解决就好
大约 2 年之前 回复
hoster
hoster 回复张大教主: 谢谢教主,改造了一下成功获取了数据,谢谢啦
大约 2 年之前 回复

select 列1,max(列2),列3,列4 from table group by 列1

Jorker_jie
Jorker_jie 你这个肯定是报错的,分组查询,select的字段除了聚合函数之外,必须出现在group by后面
大约 2 年之前 回复

select max(列2) from 表名 where 列1 <> A group by 列1 不是很懂意思,我理解的应该是这样了

//把table_name 替换成你自己的表名
select a.列1,a.列2,
(select 列3 from table_name where 列1=a.列1 and 列2=a.列2) 列3,
(select 列4 from table_name where 列1=a.列1 and 列2=a.列2) 列4
from 
(select 列1,max(列2)  列2 from table_name group by 列1) a
select t1.* from (select 列1,max(列2) from 表名 t1 group by 列1) t2 
left join t1 on t1.列1 = t2.列1

这个才对,漏了一个限制条件

select t1.* from (select 列1,max(列2) a from 表名 t1 group by 列1) t2 
left join t1 on t1.列1 = t2.列1  and  t1.列2 = t2.a

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Oracle求某一列最大值
当字段类型为文本时Varchar,超出1000数据时,求出的最大值为999,针对这个问题,解决方法是将文本转换成数值型在进行求值,求出的结果则为正确 SQL语句:  select max( TO_NUMBER(t.id))   from MDFIELD t 应该注意的是: 使用TO_NUMBER()函数的时候,一定要确保所转换字段是可转换为数字的,比如字符串“20170720
大神们帮帮忙
帮我把这两张[img=https://img-bbs.csdn.net/upload/201403/11/1394543167_283966.jpg][/img][img=https://img-bbs.csdn.net/upload/201403/11/1394543180_103316.jpg][/img]表添上
大神们可否帮帮忙!!!!
[img=https://img-bbs.csdn.net/upload/201612/29/1483008918_442719.png][/img]
求大神们帮帮忙
series: [rnrn rn name: '空气质量',rn type: 'bar',rn data: [80, 90, 86, 98, 60, 88, 90, 69, 70, 80, 67, 88]rn ,rn rn name: '降水量',rn type: 'bar',rn data: [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3]rn ,rn rn name: '平均温度',rn type: 'line',rn yAxisIndex: 1,rn data: [25, 27, 28, 26, 25, 27, 20.3, 23.4, 23.0, 16.5, 12.0, 20]rn rn ]rnrnrnrn这是js中的一段代码,怎么把这段上面data中的死数据换成从数据库中查询出来的数据?rnrnrn
大神们,帮帮忙
[code=c]#include rntemplate Type sum(Type* array,int size)rn Type total=0;rn for(int i=0;i Type sum(Type* a1,Type* a2,int size)rn Type total=0;rn for(int i=0;i
node.js 大神们帮帮忙
是一个关于网上支付的功能 ,用node.js完成,希望能有一些可用的文档或者案例,来给我安利安利 谢谢大神们 只能属于js板块了
javax.faces.view.facelets.FaceletCacheFactory 求大神们帮帮忙
严重: An error occured while initializing MyFaces: javax.faces.view.facelets.FaceletCacheFactoryrnjava.lang.IllegalArgumentException: javax.faces.view.facelets.FaceletCacheFactoryrn at javax.faces.FactoryFinder.validateFactoryName(FactoryFinder.java:653)rn at javax.faces.FactoryFinder.setFactory(FactoryFinder.java:327)rn at org.apache.myfaces.config.FacesConfigurator.setFactories(FacesConfigurator.java:498)rn at org.apache.myfaces.config.FacesConfigurator.configureFactories(FacesConfigurator.java:492)rn at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:418)rn at org.apache.myfaces.webapp.AbstractFacesInitializer.buildConfiguration(AbstractFacesInitializer.java:370)rn at org.apache.myfaces.webapp.Jsp21FacesInitializer.initContainerIntegration(Jsp21FacesInitializer.java:73)rn at org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:143)rn at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:119)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4210)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:802)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1080)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1003)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:507)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1322)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:325)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1068)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1060)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)rn at org.apache.catalina.core.StandardService.start(StandardService.java:525)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:759)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:595)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:606)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)rnrnrnrn这个到底是为什么,怎么解决呀??? 跪求
新手求大神们帮帮忙...
[code=JScript][/rnrnrnrn rn rn rn rnrnrnrnrn rn This element is on the top by defaultrn Go to Warp Speed blogrnrn Go to jQueryrn Go to Opera Mobilern rnrnrncode]
大神们帮帮忙,解决好几天了
[code=objc]2013-7-10 9:41:20 org.apache.catalina.core.ApplicationDispatcher invokern严重: Servlet.service() for servlet jsp threw exceptionrnjava.lang.ClassNotFoundException: org.apache.taglibs.standard.tlv.JstlCoreTLVrn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)rn at org.apache.jasper.compiler.TagLibraryInfoImpl.createValidator(TagLibraryInfoImpl.java:657)rn at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:243)rn at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:169)rn at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)rn at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:475)rn at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1425)rn at org.apache.jasper.compiler.Parser.parse(Parser.java:138)rn at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:239)rn at org.apache.jasper.compiler.ParserController.parse(ParserController.java:102)rn at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:197)rn at org.apache.jasper.compiler.Compiler.compile(Compiler.java:372)rn at org.apache.jasper.compiler.Compiler.compile(Compiler.java:352)rn at org.apache.jasper.compiler.Compiler.compile(Compiler.java:339)rn at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:594)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:344)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)rn at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)rn at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)rn at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)rn at org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:164)rn at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)rn at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:374)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:278)rn at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:90)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:192)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)rn at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:511)rn at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:102)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394)rn at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:284)rn at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:322)rn at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1714)rn at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)rn at java.lang.Thread.run(Thread.java:619)rn[/code]
使用pandas根据某一列的最大值选择另一列的内容
&amp;gt; #pandas 根据一列选择另一列最大的那个 &amp;gt; t_os=op_train[[&quot;UID&quot;,&quot;os&quot;]] &amp;gt; t_os[&quot;has_os_types&quot;]=1 &amp;gt; t_os=t_os.groupby([&quot;UID&quot;,&quot;os&quot;]).agg(&quot;sum&quot;).reset_index() &amp;gt; grou
求大神们帮帮忙啊、
让网页飘满玫瑰、rnrn但我想像QQ空间发完说说后飘满整个屏幕的玫瑰花瓣源码rnrn我只要一打开网页、然后自己就开始飘玫瑰、求大家帮我解决下、谢谢了rnrn我的邮箱lixunka@qq.comrnrn真的、求求大家帮帮忙、跪谢!!!!!!!!
大神们 帮帮忙 关于nutch
有谁知道怎么把nutch1.5 和eclipse整合来使用 抓取网站吗 有到麻烦详细说明下 谢谢了
web区的大神们帮帮忙!
[img=https://img-bbs.csdn.net/upload/201707/04/1499156965_289246.png][/img]rnrnrn如上图所示,我想在网页正中间输出该图形。rn(1)有10个相互作用的数值,上图是根据其中一个分子与其他分子的相似度的数值大小所作,越大越接近(ps:图片只供参考)rn(2).每个圆圈代表的是一个分子,编号1的为选中的分子,其他的是跟其相似的分子,距离越近越相似。rn[img=https://img-bbs.csdn.net/upload/201707/04/1499157614_757488.png][/img]rn(3)web要求 鼠标悬停在圆圈,显示该分子名称,悬停在连线则显示相似度;rn 如果鼠标点击分子2,则出现分子2与其他9个分子的相似图。rnrnrnrnrn
关于下拉控件问题,请大神们帮帮忙。
本人是菜鸟,正在学习VC++,遇到个问题无法解决,首先我在对话框建立的三个控件,一个combo Box,两个Edit control,在下拉控件中添加四个选项如下,collectType是下控件的一个变量,upperLimit和lowerLimit是两个文本框控件的两个变量。rn CComboBox *pComboBox=(CComboBox*)GetDlgItem(IDC_COLLECTTYPE);rn pComboBox->AddString(_T("zero"));rn pComboBox->AddString(_T("a"));rn pComboBox->AddString(_T("b"));rn pComboBox->AddString(_T("c"));rn weigthName="anything";rn collectType=0;rn upperLimit=100;rn lowerLimit=0;rn UpdateData(FALSE);rn现在我要在comboBox中添加一个事件处理程序,也是ON_CBN_SELCHANGE函数改变upperLimit和LowerLimit的初始值,比如我下拉控件选择a,这两个变量改变为其他值。应该怎么实现?最好详细点,我是新手,谢谢。
关于页面无法保存的值的问题,请大神们帮帮忙。
环境VS2003 C#.NET WEBrn公司以前用VS2003开发的项目,最近需要添加上传的功能,在公司原有的项目中无法保存值,但是,我试着新建一个项目,在新项目中却可以保存,请问大神们,这是怎么一回事啊?rn在线等侯大神们的帮助。
关于不兼容指针类型的初始化的问题,请大神们帮帮忙
#include rn#include rn#define MAXNODE 10rntypedef char datatype;rntypedef struct Binodernrn datatype data;rn struct Bitnode *lchild,*rchild;rnBitnode,*Bitree;rnvoid CreateBinTree(Bitree *T);rnvoid PreOrder(Bitree bt);rnvoid InOrder(Bitree bt);rnvoid PostOrder(Bitree bt);rnvoid LevelOrder(Bitree bt);rnint Allnode (Bitree root);rnBitree Search(Bitree bt,datatype x);rnint n2(Bitree bt);rnint Countleaf(Bitree bt);rnint main()rnrn Bitree bt,p;rn int sel;rn datatype x;rn printf("Please input your choice: \n1---Create\n2---Preorder\n3---Inorder\n4---Postorder\n5---Levelorder\n6---Allnodenumber\n7---Sreach\n8---Degree 2 nodenumber\n9---Degree 0 number\n10---quit\n");rn scanf("%d",&sel);rn while(sel!=10)rn rn if(sel==1)rn rn CreateBinTree(&bt);rn printf("Establish finish!\n");rn rn if(sel==2)rn rn printf("PreOrder is:");rn PreOrder(bt);rn printf("\n");rn rn if(sel==3)rn rn printf("InOrder is:");rn InOrder(bt);rn printf("\n");rn rn if(sel==4)rn rn printf("PostOrder is:");rn PostOrder(bt);rn printf("\n");rn rn if(sel==5)rn rn printf("LevelOrder is:");rn LevelOrder(bt);rn printf("\n");rn rn if(sel==6)rn rn printf("The number of all nodes:");rn printf("%d",Allnode(bt));rn printf("\n");rn rn if(sel==7)rn rn printf("Please input the data you want to find:");rn scanf("\n%c",&x);rn p=Search(bt,x);rn printf("%c",p->data);rn printf("\n");rn rn if(sel==8)rn rn printf("Degree 2 node number are:");rn printf("%d",n2(bt));rn printf("\n");rn rn if(sel==9)rn rn printf("The number of leaf is:");rn printf("%d",Countleaf(bt));rn printf("\n");rn rn printf("\nPlease input your choice: \n1---Create\n2---Preorder\n3---Inorder\n4---Postorder\n5---Levelorder\n6---Allnodenumber\n7---Sreach\n8---Degree 2 nodenumber\n9---Degree 0 number\n10---quit\n");rn scanf("%d",&sel);rn rn return 0;rnrnrnvoid CreateBinTree(Bitree *T)rnrn char ch;rn getchar();rn scanf("%c",&ch);rn if(ch=='0')rn rn *T=NULL;rn rn elsern rn *T=(Bitnode *)malloc(sizeof(Bitnode));rn (*T)->data=ch;rn CreateBinTree(&((*T)->lchild));rn CreateBinTree(&((*T)->rchild));rn rnrnvoid PreOrder(Bitree bt)rnrn if(bt==NULL)rn rn return;rn rn elsern rn printf("%3c",bt->data);rn PreOrder(bt->lchild);rn PreOrder(bt->rchild);rn rnrnvoid InOrder(Bitree bt)rnrn if(bt==NULL)rn rn return;rn rn elsern rn InOrder(bt->lchild);rn printf("%3c",bt->data);rn InOrder(bt->rchild);rn rnrnvoid PostOrder(Bitree bt)rnrn if(bt==NULL)rn rn return;rn rn elsern rn PostOrder(bt->lchild);rn PostOrder(bt->rchild);rn printf("%3c",bt->data);rn rnrnvoid LevelOrder(Bitree bt)rnrn Bitree queue[MAXNODE];rn int front,rear;rn if(bt==NULL)rn rn return;rn rn front=-1;rn rear=0;rn queue[rear]=bt;rn while(front!=rear)rn rn front++;rn printf("%3c",queue[front]->data);rn if(queue[front]->lchild!=NULL)rn rn rear++;rn queue[rear]=queue[front]->lchild;rn rn if(queue[front]->rchild!=NULL)rn rn rear++;rn queue[rear]=queue[front]->rchild;rn rn rnrnint Allnode (Bitree root)rnrn if(!root)rn rn return 0;rn rn elsern rn return (1+Allnode(root->lchild)+Allnode(root->rchild));rn rnrnBitree Search(Bitree bt,datatype x)rnrn Bitree p;rn if(bt)rn rn if(bt->data==x)rn rn return bt;rn rn else if(bt->lchild!=NULL)rn rn p=Search(bt->lchild,x);rn if(p)rn rn return p;rn rn rn else if(bt->rchild!=NULL)rn rn p=Search(bt->rchild,x);rn if(p)rn rn return p;rn rn rn rn return NULL;rnrnint n2(Bitree bt)rnrn if(bt==NULL)rn rn return 0;rn rn if((bt->lchild==NULL)&&(bt->rchild==NULL))rn rn return 0;rn rn if((bt->lchild!=NULL)&&(bt->rchild==NULL))rn rn return n2(bt->lchild);rn rn if((bt->lchild==NULL)&&(bt->rchild!=NULL))rn rn return n2(bt->rchild);rn rn if((bt->lchild!=NULL)&&(bt->rchild!=NULL))rn rn return n2(bt->lchild)+n2(bt->rchild)+1;rn rnrnint Countleaf(Bitree bt)rnrn if(bt==NULL)rn rn return 0;rn rn if((bt->lchild==NULL)&&(bt->rchild==NULL))rn rn return 1;rn rn elsern rn return(Countleaf(bt->lchild)+Countleaf(bt->rchild));rn rnrnrnrn在第一个子函数创立二叉树的时候,Code blocks有warning:G:\Bintree\main.c|102|warning: passing argument 1 of 'CreateBinTree' from incompatible pointer type|rn究竟该怎么办,程序长了点,但是还是希望各位高手帮帮忙
大神们 帮帮忙 还是昨晚的问题
就是电脑WIN7 系统 开VS太慢,经常出现鼠标点之后 就未响应。。。rnrn很多人说我电脑配置不好。rnrn我觉得应该不是这个问题。以前XP用都好的很。我电脑是Y450 T6600 GT240 512M显卡 2G内存 等等。。。rn这配置 够整个VS了把。。rnrn求原因。。。。
C语言问题,大神们帮帮忙!
#include rnint main(void)rnrn int a=0;rn char ok=0; rn printf("请输入你的成绩:");rn scanf("%c",&ok);rn if(a<60&&ok>=0)rn rn ok ='E';rn rn else if(a<70)rn rn ok='D';rn rn else if(a<80)rn rn ok='C';rn rn else if(a<90)rn rn ok='B';rn rn else if(a<=100)rn rn ok='A';rn rn else if(a<0||a>100)rn rn ok='P';rn rn switch(ok)rn rn case 'A':rn rn printf("成绩优秀!\n");rn rn break;rn case 'B':rn rn printf("成绩上等!\n");rn rn break;rn case 'C':rn rn printf("成绩中等!\n");rn rn break;rn case 'D': rn rn printf("成绩下等!\n");rn rn break;rn case 'E':rn rn printf("成绩不及格!叫你家长来!\n");rn rn break;rn default: rn rn printf("输入错误,请确认后再输入!\n"); rn rn break;rn rn return 0;rn rn大家看一下是哪里的错误!
关于web问题,大神们帮帮忙
本人最近在弄一个在jsp页面点击弹出一个咨询框实现即时聊天的功能,那我该怎么弄?有点类似webQQ的模式
大神们,进来帮帮忙,DNS问题
大神伸出你们的援助之手帮帮小弟啊,我新做了一个网站,放在192.168.0.7上,然后通过路由器映射到外网的ip上,并且可以通过外网ip和内网ip访问这个网站,但是我想通过域名来访问这个网站,请问我该怎样架设DNS让内网和外网都可以通过域名来访问这个网站,请各位大神帮帮忙啊...小弟在此谢过了
C# 串口通讯问题,求大神们帮帮忙
是这样的 我在网上弄了一个代码,串口通讯的,出现的问题在于 这个串口通讯的代码 不好用。rnrn如何不好用法rnrn01 单独运行它 ,发送不出去数据。rn02 当我开启串口测试助手之后,再把串口测试助手关闭,在运行就可以用rn03 我问了 好多人,说 可能是初始化的问题,或者是串口到底有没有打开。rnrnrn大家能帮忙解决一下这个问题吗?rnrn代码 在此 rncardCom.PortNum = 1;rn cardCom.BaudRate = 57600;rn cardCom.ByteSize = 8;rn cardCom.Parity = 0;rn cardCom.StopBits = 1;rn cardCom.ReadTimeout = 500;rn if (this.OpenCom())rn rn msg.AppendText("串口初始化成功……\r\n");rn rn elsern rn msg.AppendText("串口初始化失败!\r\n");rn rnrn剩下的代码大家可能都知道,就是在网上下的通用版本! rn
虚表问题,求大神们帮帮忙看看
想通过虚表来输出一个age。。为什么老是输出错误啊。rn#include rn#include rn#include rnusing namespace std;rnclass Animalrn int age;rn public:rn virtual void run()rn cout<<"animal run"<(malloc(4));rn memcpy(pi,&a+5,4);rn cout<<"age="<<*pi<
TreeView 绑定的问题。求大神们帮帮忙。
gndm djfldm1 djfl1 djfldm2 djfl2 djfldm3 djfl3 sfdyrnD010101000 1 登记 1 初始 1 商品房 1rnD010102000 1 登记 1 初始 2 单位 1rnD010103000 1 登记 1 初始 3 个人 1rnD010199000 1 登记 1 初始 99 其他 1rnD010201000 1 登记 2 转移 1 买卖 1rnD010202000 1 登记 2 转移 2 赠与 1rnD010203000 1 登记 2 转移 3 继承 1rnD010204000 1 登记 2 转移 4 分割 1rnD010205000 1 登记 2 转移 5 产权 1rnD010206000 1 登记 2 转移 6 兼并 1rnD010207000 1 登记 2 转移 7 作价 1rnD010208000 1 登记 2 转移 8 生效 1rnD010299000 1 登记 2 转移 99 其他 1rnD010301000 1 登记 3 变更 1 姓名 1rnD010302000 1 登记 3 变更 2 地址 1rnD010303000 1 登记 3 变更 3 面积 1rnD010304000 1 登记 3 变更 4 同一 1rnD010399000 1 登记 3 变更 99 其他 1rnD010401000 1 登记 4 注销 1 房屋 1rnD010402000 1 登记 4 注销 2 房屋 1rnD010499000 1 登记 4 注销 99 其他 1rnrn表结构是这样的,gndm 唯一标识 djfldm1 父节点 djfl1 节点名称 rndjfldm2 子节点 djfl2 节点名称 rndjfldm3 孙节点 djfl3 节点名称 rn递归好像用不了,详细代码最好。
大神们帮帮忙,launcher桌面UI的问题
桌面图标刚进入的时候是下图所示:rn[img=https://img-bbs.csdn.net/upload/201506/19/1434700424_785178.jpg][/img]rn当选中之后,图中的圆圈和数据会被挡住,如下图所示:rn[img=https://img-bbs.csdn.net/upload/201506/19/1434700485_718092.jpg][/img]rn图中显示圆圈和数据的控件是放在另外一个XML文件(layout_memory.xml)里面的,代码如下:rn[code=java]rnrnrn rn rn rn rn rnrn[/code]rnrn我是在layout_main里面使用include对layout_memory进行关联:rn[code=java]rnrn[/code]rnrnlayout_memory里面的控件和layout_main里面的控件重叠了,当在选中状态的时候,显示的是放大之后的layout_main里面的控件,layout_memory被挡住了,就算再次取消焦点也会被挡住。rn请教怎么让layout_memory.xml始终显示在最上层呢?
resultSet.getString()方法的传参的问题,大神们帮帮忙
[i][/i] while(rs.next())rn %>rn rn <%rn rn for(int j=0;jrn <%out.println(rs.getString(x)); %> // 这行正确,能取到相应的列的值rn <%out.println(rs.getString(y)); %> //但是这行却报错,取不到y对应的列的值rnrn <%rn rn %>rn <%rn rn %>rnrnrnrn这是为什么啊 ,resultSet.getString()方法不能传变量进去吗?
关于 Expression.Call 的问题,各位大神们,帮帮忙。。
[code=C#]rnpublic class Collectrnrn /// rn /// 测试。。rn /// rn public static void AAA(int strd)rn rn rn rn public void Test()rn rn //第一种写法。rn var bbbaa = Expression.Call(rn Expression.Parameter(typeof(Collect), "Collect"),rn typeof(Collect).GetMethod("AAA", new Type[] typeof(int) ),rn new Expression[]rn rn Expression.Constant(2)rn rn );rn //第二种写法。rn var aaa = Expression.Call(rn typeof(Collect),rn "AAA",rn new Type[] typeof(int) ,rn new Expression[] rn rn Expression.Constant(2) rn rn );rn rnrn[/code]rnrn问题是:rnrn第一种写法是正确。。rnrn但是第二种写法总是报异常:rnrn“类型“Collect”上没有方法“AAA”与提供的参数兼容。”rnrn弄来弄去。。总是不正常。。也不知道哪里写错了。各位大神帮帮忙啊。。实现第二种写法。。rnrn先谢谢了。。rn
行列转换方面的问题。帮帮忙!!!大神们!!!
有一个表记录的是学生的成绩rn例如:rnid 课程 成绩rn1 英语 60rn1 数学 70rn1 政治 60rn1 网络基础 66rn1 计算机基础 89rn2 英语 60rn2 数学 70rn2 政治 60rn2 网络基础 66rn2 计算机基础 89rn3 英语 60rn3 数学 70rn3 政治 60rn3 网络基础 66rn3 计算机基础 89rnrnrn现在我要查询出来显示成下面这样rnid 英语 数学 政治 网络基础 计算机基础rn1 60 70 60 66 89rn2 60 70 60 66 89rn3 60 70 60 66 89rnrn
开源框架的选择问题,求大神们指导...
rnrn 想做一个简单的社交网站,主要是分享照片的功能,所以希望能选一款轻量级的社交开源框架,求指点。
请大神们帮忙
在WP中怎么自定义一个控件,使得当我点击不放的时候里面内容出现另一个内容,而当我点击结束弹起时回到原来的内容。
新手 myeclipse问题 大神们快帮帮忙
在弄一个工程,可是.java文件不能导出想要的.class文件,下面是某一个没成型的.class文件,刚学对项目和myeclipse都不熟,希望大家给指点指点。rnrnrn// Compiled from ShipManManager.java (version 1.6 : 50.0, no super bit)rnpublic abstract interface manager.ShipManManager rn rn // Method descriptor #6 ()Vrn // Stack: 3, Locals: 0rn static ;rn 0 new java.lang.Error [8]rn 3 duprn 4 ldc [10]rn 6 invokespecial java.lang.Error(java.lang.String) [12]rn 9 athrowrn Line numbers:rn [pc: 0, line: 1]rn rn // Method descriptor #19 (Ljava/lang/String;)LShipMan;rn public abstract ShipMan findShipManOracle(java.lang.String arg0);rn rn // Method descriptor #21 (LShipManQueryInfo;)Ljava/util/List;rn public abstract java.util.List searchShipMansOracle(ShipManQueryInfo arg0);rn rn // Method descriptor #19 (Ljava/lang/String;)LShipMan;rn public abstract ShipMan findShipMan(java.lang.String arg0);rn rn // Method descriptor #24 (LShipManQueryInfo;Ljava/lang/Integer;Ljava/lang/Integer;LUser;)Ljava/util/List;rn public abstract java.util.List searchShipMans(ShipManQueryInfo arg0, java.lang.Integer arg1, java.lang.Integer arg2, User arg3);rn rn // Method descriptor #26 (Ljava/lang/String;)Ljava/util/List;rn public abstract java.util.List findShipManById(java.lang.String arg0);rn rn // Method descriptor #28 (LShipMan;)Vrn public abstract void addShipMan(ShipMan arg0);rn rn // Method descriptor #15 (Ljava/lang/String;)Vrn public abstract void delShipMan(java.lang.String arg0);rn rn // Method descriptor #28 (LShipMan;)Vrn public abstract void updateShipMan(ShipMan arg0);rnrn
树形联动的问题,大神们帮帮忙吧。
-
一个简单的问题,大神们帮帮忙
定义一个网络用户类,要处理的信息有用户Id,用户密码,email地址。在建立类的实例时,把以上三个信息都作为构造函数的参数输入,其中用户ID和用户密码时必须的,缺省的email地址是用户ID加上字符串”@gameschool.com”
大神们帮帮忙,一个简单问题
有两个 ToolStripComboBox,一个 toolStripComboBox1,一个 toolStripComboBox2,我在 toolStripComboBox1用数据库导入了机车类型type,我希望在 toolStripComboBox1选择好机车类型后,另一个 toolStripComboBox2中则出现对应的机车号码num,我写了段代码,但总是用问题,请大侠看看,怎么改实现这个功能?rn private void toolStripComboBox1_Click(object sender, EventArgs e)rn rn SqlConnection con = new SqlConnection(Properties.Settings.Default.server);rn con.Open();rn string mysql = "select distinct type from jichexinxi";rn SqlCommand cmd = new SqlCommand(mysql, con);rn SqlDataReader dr = cmd.ExecuteReader();rn toolStripComboBox1.Items.Clear();rn while (dr.Read())rn rn toolStripComboBox1.Items.Add(dr[0].ToString());rnrn rn dr.Close();rn rnrn private void toolStripComboBox2_Click(object sender, EventArgs e)rn rn SqlConnection con = new SqlConnection(Properties.Settings.Default.server);rn string sql = "select num from jichexinxi where type = '" + toolStripComboBox1.SelectedItem.ToString( ) + "'";rn con.Open();rn SqlCommand cm = new SqlCommand(sql, con);rn SqlDataReader drr = cm.ExecuteReader();rn this.toolStripComboBox2.Items.Clear();rn while (drr.Read())rn rnrn toolStripComboBox2.Items.Add(drr[0].ToString());rnrn rn drr.Close();rn
请大神帮帮忙!
我使用appface,按照网上的方法出现如下问题,求解:rn[img=http://img.my.csdn.net/uploads/201303/23/1364047772_4335.jpg][/img]rn请问如何解决?rn谢谢!
请大神再帮帮忙~
请大神再帮忙看看这个程序好么?rn#include rnusing namespace std;rnclass testrnpublic:rntest();rnint getint()return num;rnfloat getfloat()return fl;rn~test();rnprivate:rnint num;rnfloat fl;rn;rntest::test()rncout<<"Initalizing default"<
请各位大神帮帮忙
刚Javaspringboot,有道题实在解决不了,请各路大神帮帮忙 图片: 点击查询时,能在控制台上打印出你选择的图书类型
请java大神帮帮忙。。
package simple;rnrnpublic class test1 rn static int x=100;rn static void m()rn System.out.println(x);rnrnrnrnclass test2 extends test1rnstatic int x=200;rn static void m()rn System.out.println("x="+x);rn System.out.println("super.x="+super.x);//出错了rn super.m();// 出错了rn rn public static void main(String args[])rn //test1 a=new test1()rn test1 a=new test2();rn a.m();rn System.out.println(a.x);rn rnrn为什么不能调用父类的方法跟属性了?
请大神帮帮忙
1rn 2 1 2rn 3 2 1 2 3rn 4 3 2 1 2 3 4rn5 4 3 2 1 2 3 4 5rnrn这个数字三角怎么用java实现??
紧急!请大神帮帮忙!
我在插入数据时提示rn严重: Servlet.service() for servlet default threw exceptionrncom.microsoft.sqlserver.jdbc.SQLServerException: 不能将值 NULL 插入列 'username',表 'seconddhand.dbo.usertable';列不允许有空值。INSERT 失败。rn 'username'是vchar类型的,而且也有值,不知道为什么老是提示为null。
请高手们帮帮忙!!!:—)
我已经是过很多次了,可是还是不行!!!rn不知道为什么,在自己的程序中会遇到那么多的问题?rn就想现在的这个问题一样,看好像很简单,可是,我在BDE Administrator中rn无论怎么设置,结果都是一样,以下是我的部分资料:rnrnrn1。我用的是DBASE的数据库,自己建立的,语言是CHINA 9??(不记得了)rn2。我用的是DBEDIT,我希望在输入自己姓名的时候可以在DBGRID中显示自己的名字。rn3。我用数字和英文试过了,都可以,但是为什么中文不行?rn请指教,谢谢!!
相关热词 c# 标准差 计算 c#siki第五季 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池