将代码从Oracle 8i转换为MySQL

时间:2018-09-02 06:51:50

标签: mysql oracle

如何将下面的代码从Oracle 8i转换为MySQL-

select count(*) 

from   patient_visit,
        organization_master
where patient_visit.organization_id=organization_master.organization_id(+);   

在where语句“ organization_master.organization_id(+)”在MySQL中不起作用。

建议。

2 个答案:

答案 0 :(得分:1)

(+)是外部联接的Oracle特定表示法。 我想你应该写这样的东西

public class Main4Activity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main4);
    }

    Button advance, next;
    TextView tv;

    public void msgClickClose(View view) {
        setContentView(R.layout.activity_main4);
        advance = findViewById(R.id.button5);
        tv = findViewById(R.id.msg);
        next = findViewById(R.id.button3);
        advance.setVisibility(View.INVISIBLE);
        tv.setVisibility(View.INVISIBLE);
        next.setVisibility(View.VISIBLE);
    }

我没有测试它,因为我没有数据可以测试它,但是它应该可以工作。

希望有帮助

答案 1 :(得分:0)

您将需要使用所有现代SQL数据库(以及Oracle)支持的标准<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <build> <plugin> <inherited>false</inherited> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.6</version> <executions> <execution> <id>test</id> <phase>install</phase> <goals> <goal>run</goal> </goals> <configuration> <target name="test"> <scp trust="true" failonerror="true" verbose="off" sftp="true" file="" todir="" /> <sshexec trust="true" failonerror="true" host="test.server" username="testuser" password="test" command="" timeout="1000" /> <taskdef name="scp" classname="org.apache.tools.ant.taskdefs.optional.ssh.Scp"> <classpath refid="maven.plugin.classpath" /> </taskdef> </target> </configuration> </execution> </executions> <dependencies> <dependency> <groupId>ant</groupId> <artifactId>ant-commons-net</artifactId> <version>1.6.5</version> </dependency> <dependency> <groupId>org.apache.ant</groupId> <artifactId>ant-jsch</artifactId> <version>1.9.1</version> </dependency> </dependencies> </plugin> </build> </project> 语法:

JOIN

如果您还有其他没有select count(*) from patient_visit left join organization_master on patient_visit.organization_id = organization_master.organization_id 的联接,则只需用(+)替换那些联接:完全避免在inner join子句中使用逗号。其他非联接条件仅保留在from子句中。

例如:

where