Hii guys, Here v can discuss about Problems in database design. If u know the answers , plese post ur answers here.
How do u get the distinct rows in a table/resultset?
How do u get the distinct rows without using the keyword DISTINCT?

By using the DISTINCT keyword,this can be achieved.The following example selects the distinct names from the employee table.
SELECT DISTINCT lname FROM employee.

By using the GROUP BY keyword,this can be achieved.The following example selects the distict names in the employee table,without using the DISTINCT keyword.
SELECT lname FROM employee GROUP BY lname.

Hey guys,
Me too have one doubt regarding database.

How can we insert a values in multiple rows using one insert statement ?
Please show one example.

Haii..
The answer is,
INSERT INTO table
select('value1','Cina')
UNION ALL
select('value2','Dina')
UNION ALL
select('value3','Tina')

Thank you..

Hieo frnds...
Please help me out for finding the answer for this problem.

How can we get the duplicate rows from the table listed below using a single query.??

field1 field2 field3

1 2 3
2 4 5
2 4 5
3 4 3
1 2 3

Hii frnds..
CREATE INDEX myIndex ON myTable(myColumn). What type of index will get created after executing the above statement? Why ?

and How can we swap values between two rows in a table using single sql statement?
show some examples also..

Hieo frnds...
Please help me out for finding the answer for this problem.

How can we get the duplicate rows from the table listed below using a single query.??

field1 field2 field3

1 2 3
2 4 5
2 4 5
3 4 3
1 2 3

1> select *,count(*) as instances from DUPS group by field1,field2,field3
2> go
field1 field2 field3 instances
----------- ----------- ----------- -----------
1 2 3 2
2 4 5 2
3 4 3 1

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.