DB2 query !!

Ask question on - DataBase Concepts, IBM Mainframe DB2, DB2/UDB, DB2 Tools, SQL , DB2 programming with languages like COBOL, PL1.

Moderators: Kalicharan, Moderator Group

Post Reply
pradeepshan

DB2 query !!

Post by pradeepshan » Thu Feb 16, 2006 8:20 pm

how will you select a rec from a table having a name with 'c' starts in the second position?

eg:mclaran

Table contain Empname, empno,city

also if suppose the name is '_caterina' how will you get it?

Guest

Post by Guest » Thu Feb 16, 2006 11:18 pm

select from <list of columns to be selected>
from <table name>
where name like '_c%';

lucky.rohith
Member
Posts: 8
Joined: Mon Aug 21, 2006 4:23 pm

hi

Post by lucky.rohith » Thu Sep 14, 2006 7:17 am

select empname, city from emp where empname = '-c%'

156138
Member
Posts: 15
Joined: Tue Aug 29, 2006 7:27 pm
Location: Chennai

Db2 query

Post by 156138 » Fri Sep 15, 2006 12:19 pm

Select (colums whichever you want)
INTO(.......)
FROM table name A
WHERE A.name LIKE '_C%'
Regards,
Vinod Reddy.

dorianz
Member
Posts: 1
Joined: Tue May 17, 2011 9:06 am

Re: DB2 query !!

Post by dorianz » Sat May 28, 2011 10:21 am

Last edited by dorianz on Sun Aug 16, 2015 1:06 pm, edited 3 times in total.

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Mon May 30, 2011 7:24 pm

Pardon my ignorance, but, what are you trying to say, dorianz?
Regards,
Anuj

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Mon May 30, 2011 8:33 pm

in a five-year-old thread
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others