Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
leracj
Starting Member
13 Posts |
Posted - 2013-06-29 : 15:44:20
|
how about if i want to insert another row basically i want to have a row for first name and another row for addresshow do i do that?my code:SELECT DISTINCT ID, user_login, user_email, meta_value, COUNT( * ) , meta_keyFROM wp_users um, wp_usermeta uWHERE (user_login LIKE '%tho%'OR meta_value LIKE '%tho%'OR user_email LIKE '%tho%')AND (user_id = IDAND (meta_key = 'first_name'OR meta_key = 'last_name'OR meta_key = 'last_name'OR meta_key = 'city'OR meta_key = 'address'OR meta_key = 'programs'))GROUP BY ID, user_login, user_emailHAVING COUNT( * ) >0ORDER BY (CASE meta_keyWHEN 'first_name'THEN 1 ELSE 100 END) ASC , meta_key ASC , meta_valueLIMIT 0 , 30please helpplease help |
|
MuMu88
Aged Yak Warrior
549 Posts |
Posted - 2013-06-29 : 19:01:58
|
Which version of SQL Server are you using? |
|
|
|
|
|