Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL SYNTAX
Message
From
11/04/2001 03:00:50
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australia
 
 
To
11/04/2001 02:44:45
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00494306
Message ID:
00494308
Views:
17
Hi Mohammed,

The following will give you a Cursor of all names in a table where the last name occurs more than once:
SELECT UPPER(lastname) AS lastname ;
   FROM mytable ;
   GROUP BY 1 ;
   HAVING COUNT(*) > 1 ;
   INTO CURSOR firstpass_cursor

SELECT mytable.* ;
   FROM firstpass_cursor, mytable ;
   WHERE UPPER(mytable.lastname) = firstpass_cursor.lastname ;
   INTO CURSOR secondpass_cursor ;
   ORDER BY firstpass_cursor.lastname
Hope this helps,
Gavin...

>I want sql command of query
>
>
>I want name of all the persons whos last name is same in the table
>
>Plese help me
>
>
>Thanks
>Mohammed
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform