Wednesday, September 12, 2018

Concat&Limit Slight Difference Between Oracle and Mysql


CONCAT

Oracle:

select concat(b.pkey, concat('-', a.issuenum)) as PKEY from jira.jiraissue a join jira.project b on a.project = b.id where a.id in (xxxx,xxxx);


Mysql:

select concat(b.pkey, '-', a.issuenum) as PKEY from jira.jiraissue a join jira.project b on a.project = b.id where a.id in (xxxx,xxxx);

LIMIT

Oracle:

SELECT ID, UPDATED FROM JIRA.JIRAISSUE ORDER BY UPDATED FETCH FIRST 5 ROWS ONLY;

Mysql:

SELECT ID, UPDATED FROM JIRA.JIRAISSUE ORDER BY UPDATED DESC LIMIT 5;

Refer stackflow link

No comments: