I have two tables: CardInfo and CardItems, so each CardInfo may have multiple CardItems. I need a SQL query to fetch unique records from CardInfo on the basis of some conditions which relates with both CardInfo and CardItems tables.
select c.* from CardInfo c, CardItems ci
where c.cr_no = ci.cr_no and ci.wc_id = 'test'
The above query return duplicate records. Please suggest a solution.
you can remove duplicate records with
DISTINCT